Skip to content

Instantly share code, notes, and snippets.

@konsumer
Created September 26, 2012 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konsumer/3789086 to your computer and use it in GitHub Desktop.
Save konsumer/3789086 to your computer and use it in GitHub Desktop.
Basic analog read
int analogPin = 3;
int val = 0;
void setup() {
Serial.begin(9600); // setup serial
}
void loop() {
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment