Hi Everyone.
I have started to learn Arduino programming .
I want to write a program and got doubt.
If I write a delay in the program it will pause the program in that state
Ex:- In a blink program if keep delay(10000); it is keeping the LED light ON for 10 seconds.
I want to Switch OFF in middle of the 10 seconds time.
How to do that? Can we use the interrupt command to switch OFF the light.
Below this is the problem:-
I have two push buttons- Button A and Button B.
3 LEd's - LED1, LED2, LED3
Initial state All THREE LEDs are in switch OFF mode.
I need to press the button only once and LED1 should switch ON for 20 seconds.
If i press two times continuously LED2 should switch ON and it should be ON for 20 Seconds,
If I press three times continuously then LED3 should Switch ON it should be ON for 20 Seconds.
In above all based on the press only one LED should Switch ON.
I have one more button (button2) , Its a emergency button.
When I press the Button2, it should switch OFF all the LEDs without any delay.
Please help me to write the code on this and give me a solution.
I tried debounce and interrupt command but could not able to write the code properly.
Thanks in Advance.