52. Single Double and Long Press with Interrupts

Design a task using Arduino UNO with the following requirements

Button Press Actions 

  • Single press → toggle LED 1
  • Double press → toggle LED 2
  • Long press → turn OFF both LEDs. (more than 1 second)

Button Debouncing 

  • Implement debouncing to prevent multiple detections from a single button press.

INTERRUPT 

  • The controller is constantly busy in the while() loop as shown below code, so use Interrupts to perform other tasks.

The void loop() function must be executed and remain exactly as provided in the below code


void loop() {
  while (true) {
    //In this loop Microcontroller is busy in monitoring and performing important tasks constantly.
  }
}



 

Submit Your Solution