void setup(){ pinMode(9, OUTPUT); } void loop(){ if(analogRead(0)<500){ digitalWrite(9, HIGH); } else { digitalWrite(9, LOW); } }