Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (18 sloc) 663 Bytes
// 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(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// print the results to the serial monitor:
//Serial.print("sensor = " );
Serial.println(sensorValue);
// wait in milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(10);
}
You can’t perform that action at this time.