(click to enlarge) |
This experiment is similar to the previous one. The components and the circuit are the same as that of this experiment of the Pull down resistor. In that experiment we used a momentary switch to momentarily turn on the LED. Whereas in today's experiment we will turn on the LED and keep it on until the button is pressed again. Hence it will work as a Toggle switch instead of a momentary switch. We can achieve this effect by making changes in the code that we upload on the Arduino's board.
We are going to to use the example program in Arduino's IDE
File - Examples - Digital - Debounce
But the name is strange!, it is not toggle or something similar. It is Debounce. What is de-bounce ? What is it that is bouncing in this circuit that we need to de-bounce? Let us try to understand that below.