Skip to content

Instantly share code, notes, and snippets.

@woodif
Created July 15, 2015 08:49
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 woodif/7384ba7be4363388eb98 to your computer and use it in GitHub Desktop.
Save woodif/7384ba7be4363388eb98 to your computer and use it in GitHub Desktop.
/*
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