//Toogle Led me debounce //O pio swstos katati gnwmi mou tropos int led = 13; // LED on pin 13 int switchPin = 2; // switch on pin 2 boolean state = false; void setup() { pinMode(led, OUTPUT); pinMode(switchPin, INPUT); } void loop() { if (digitalRead(switchPin) == HIGH) { delay(30); // debounce sto patima state = !state; // toggle state variable digitalWrite(led,state); while (digitalRead(switchPin) == HIGH); // anamoni oso einai patimeno (to programma menei kollimeno edw.feugei otan afethei to button) delay(30); // debounce sto afima } }