Created
July 15, 2015 08:49
-
-
Save woodif/7384ba7be4363388eb98 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
/* | |
Analog input, analog output, serial output | |
*/ | |
// These constants won't change. They're used to give names | |
// to the pins used: | |
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
int sensorValue = 0; // value read from the pot | |
void setup() { | |
// initialize serial communications at 9600 bps: | |
Serial.begin(115200); | |
} | |
void loop() { | |
// read the analog in value: | |
sensorValue = analogRead(analogInPin); | |
// print the results to the serial monitor: | |
Serial.print("sensor = " ); | |
Serial.println(sensorValue); | |
delay(50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment