int potPin = 0; // select the input pin for the potentiometer
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor
Serial.print(val);
Serial.print(" ");
delay(200);
}

No comments:
Post a Comment