if (BUTTON1 == 0) //pushed { DelayMs(100); // delay for 100 milliseconds while (BUTTON1 == 0)
{ //wait while pushed } DelayMs(100); // delay for 100 milliseconds LED1 = !(LED1); // turn LED on/off }
goto start;
But there are some stuff that I didn't take into account, and therefor it works wrong. Sometimes when I click the button LED don't torn off/on. And sometimes LED switches when I do not touch the button.