int val =0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
val=analogRead(0);
Serial.println(val);
delay(100);
if (val<400){
digitalWrite(13, LOW);
delay(1000);
}
else{
digitalWrite(13,HIGH);
delay(1000);
}
}