Build a task using a microcontroller to detect single, double, and long presses of the push button switch with the following requirements:
Main Loop Constraint:
The controller is constantly busy executing critical tasks inside the while() loop in the main function, as shown in the code below, so use Interrupts to implement tasks.
main () {
while (true) {
//In this loop Microcontroller is busy in monitoring and performing critical tasks constantly.
}
}