int val_pot;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(7, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
val_pot = analogRead(A0);
Serial.print("The digital value is: ");
//print out the value you read on the serial monitor
Serial.println(val_pot);
if(val_pot > 300) {
digitalWrite(7, HIGH);
} else {
digitalWrite(7, LOW);
}
//Wait 10 ms for the next reading.
delay(100);
}