val = analogRead(buttonpin); Serial.println(val,DEC); if (val < 600) { digitalWrite(Led, HIGH); } else { digitalWrite(Led, LOW); }