Skip to content

Instantly share code, notes, and snippets.

@scottswaaley
Last active March 22, 2016 16:21
Show Gist options
  • Save scottswaaley/9cd5c38c4ff8cc757413 to your computer and use it in GitHub Desktop.
Save scottswaaley/9cd5c38c4ff8cc757413 to your computer and use it in GitHub Desktop.
A great intro sketch for writing analog sensor data to the serial bus.
/*
An Arduino sketch that reads an analog 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 = analogRead(A0);
Serial.println(sensorValue);
delay(50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment