Skip to content

Instantly share code, notes, and snippets.

@scottswaaley
Last active March 22, 2016 15:07
Show Gist options
  • Save scottswaaley/3af0f7ea5ddcc56c0700 to your computer and use it in GitHub Desktop.
Save scottswaaley/3af0f7ea5ddcc56c0700 to your computer and use it in GitHub Desktop.
/*
An Arduino sketch that reads a digital input from pin A0 and writes a '0' or '1' to the serial bus.
*/
void setup() {
Serial.begin(9600);
Serial.println("SERIAL READY");
}
void loop() {
int sensorValue = digitalRead(A0);
//int dataValue = map(sensorValue,0,800,0,255);
//Serial.println(sensorValue);
Serial.println(sensorValue);
delay(50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment