Skip to content

Instantly share code, notes, and snippets.

@SLOLNE
Last active January 27, 2016 18:25
Show Gist options
  • Save SLOLNE/343c244fae9e521a114a to your computer and use it in GitHub Desktop.
Save SLOLNE/343c244fae9e521a114a to your computer and use it in GitHub Desktop.
//Camille Kauffman
//excercise 5-5 from Getting started with Arduino
const int SENSOR = 0; // select the input pin for the // sensor resistor
int val = 0; // variable to store the value coming // from the sensor
void setup() {
Serial.begin(9600); // open the serial port to send // data back to the computer at
}
void loop() {
// 9600 bits per second
val = analogRead(SENSOR); // read the value from // the sensor
Serial.print(“val = “);
Serial.println(val); // print the value to // the serial port
delay(100); // wait 100ms between // each send
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment