Skip to content

Instantly share code, notes, and snippets.

@houhr
Last active October 28, 2015 23:43
Show Gist options
  • Save houhr/b94650e4d1fcd35da4b4 to your computer and use it in GitHub Desktop.
Save houhr/b94650e4d1fcd35da4b4 to your computer and use it in GitHub Desktop.
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment