In this project, I am going to teach you how to give multiple functions in a single push switch. Below is the list of different ways of using the switches for different functions,
- Single Tap
- Double Tap
- Triple Tap
- Four Tap
- Tap and hold
"there can be more if you can be creative"
- First, we calculate the time gap between each button press and the number of times the button is pressed
- Then according to the no. of times, the button is pressed we are calling different functions
- like the same way if the time gap is more than the preset value then we consider it as a "hold" and we call the functions which we associate to it
watch the full video for detailed programming instructions.
- Connect one leg of the push button to any digital pin.
- connect the other leg to ground of Arduino.
I have explained every line of the code in the above video.
Dont click: https://tinyurl.com/yxkrhxyg