int potVal;
int dur = 500;
int potPin = A0;
int pin = 7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(potPin, INPUT);
pinMode(pin, OUTPUT);
}
void loop() {
potVal = analogRead(potPin);
Serial.println(potVal);
delay(dur);
while(potVal > 1000){
digitalWrite(pin, HIGH);
potVal = analogRead(potPin);
Serial.println(potVal);
delay(dur);
}
digitalWrite(pin, LOW);
}