Created
February 23, 2015 18:07
-
-
Save bigjosh/41dec494662dd7b3e3bf to your computer and use it in GitHub Desktop.
Check analog input value
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
int sensorPin = A0; // select the input pin for the potentiometer | |
int sensorValue = 0; // variable to store the value coming from the sensor | |
void setup() { | |
Serial.begin(9600); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for Leonardo only | |
}} | |
void loop() { | |
// read the value from the sensor: | |
sensorValue = analogRead(sensorPin); | |
Serial.println( sensorValue ); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment