Last active
January 27, 2016 18:25
-
-
Save SLOLNE/343c244fae9e521a114a to your computer and use it in GitHub Desktop.
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
//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