Last active
March 22, 2016 16:21
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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