// Black - ground wire
// Red - Power supply wire
// the middle pin for the potentiometer must be connected to an analogue pin
const int potentiometer = A2; // or use #define potentiometer A2
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(potentiometer)); //value between 0 and 1023
delay(100);
}
//here is code for turning on the LED if the button is pressed