Single Switch Multiple Functions

Single Switch Multiple Functions


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
  • Hold
  • Tap and hold

“there can be more if you can be creative” 

Single Switch Multiple Functions - Arduino



Things Required

  • 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.


Single Switch Multiple Functions - Arduino circuit
  • Connect one leg of the push button to any digital pin.
  • connect the other leg to the ground of Arduino.

Full Video

Part 1

Part 2


Leave a Reply