52Views4Replies

Author Options:

I want to operate 3 different LED's using single push button? Answered

I mean when i'll press the button, 1st LED should glow and it should be turn off after few second... and when i'll press this button for 2nd time, only 2nd LED should glow and it should be turn off like 1st .when i'll press this button for 3rd time, only 3rd LED should glow and it should be turn off . what to do??? can anyone help me?

Tags:Arduino

Discussions

None
JRV31

3 years ago

count = 0
while button up wait for button press
while button down wait for button release (Debounce)
count++
switch case count
case 1 do count 1 stuff
break
case 2 do count 2 stuff
break
case 3 do count 3 stuff
count = 0
loopback

None
steveastrouk

3 years ago

Simplest method, use an Arduino.

None
thered4321steveastrouk

Answer 3 years ago

Thank you for your reply..

but that's what i was asking, how can i do it using Arduino?

i tried the program but in that case LEDs are not going to be turn off,

None
steveastroukthered4321

Answer 3 years ago

Your question didn't MENTION an Arduino. I took your question to mean "How do I do this ? " not, "I have an arduino and my program doesn't work"

Now you say" i tried the program", but you don't say WHAT program.