@PaulS:
I thought that since the nature of digitalRead() return value is between HIGH and LOW, I could use boolean.
now i know better.
Arrch:
if (millis()-LastDebounceTime>=10UL)
{
if (digitalRead(Switch) ==LOW)
{
LedState = !LedState;
}
}
Keep in mind that first if statement won't just run once. Once the switch has been LOW for more than 10 ms, it will run over and over again, toggling the LED state each iteration.
yes when you say about it, i realize that my understanding towards the program is totally false.