int seisund; int sees=0; //0-väljas, 1-sees int eelmine=LOW; void setup(){ pinMode(13, OUTPUT); pinMode(7, INPUT); } void loop(){ seisund=digitalRead(7); if((seisund==HIGH) && (eelmine==LOW)){ sees=1-sees; delay(100); } eelmine=seisund; if(sees==0){ digitalWrite(13, LOW); } else { digitalWrite(13, HIGH); } }