Skip to content

Instantly share code, notes, and snippets.

@TURBULENTE
Created June 29, 2016 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TURBULENTE/3d0dd2db03f7405466cc23848372374c to your computer and use it in GitHub Desktop.
Save TURBULENTE/3d0dd2db03f7405466cc23848372374c to your computer and use it in GitHub Desktop.
Data reading using ATtiny 45
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0,2); //rx,tx (set 2 pins as rx,tx)
byte sensorPin = 3;
void setup() {
mySerial.begin(9600);
pinMode(sensorPin, INPUT);
}
void loop() {
int buttonstate= analogRead(sensorPin);
mySerial.println(buttonstate);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment