Better millis() program

Better millis() program


This program introduces a variable called ledOn to record whether the LED is on or off. It is a Boolean datatype as this can only take 2 values true or false making the if statement easier. So before the program turns the LED on and resets the 'start' value BOTH the switch has to be closed AND (&&) the LED has to be off.
So if you press the switch when the LED is already on the program won't do anything.
Happy days. :-)

Comments

Popular posts from this blog

Controlling Servos