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”
- Arduino or any other compatible board
- Micro push button
- RGB LED, for testing the switch functions.
- 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 the ground of Arduino.