Skip to content

Instantly share code, notes, and snippets.

@bigjosh
Created February 23, 2015 18:07
Show Gist options
  • Save bigjosh/41dec494662dd7b3e3bf to your computer and use it in GitHub Desktop.
Save bigjosh/41dec494662dd7b3e3bf to your computer and use it in GitHub Desktop.
Check analog input value
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