3 leds and a button, thought it was going to be simple.
i have built circuit 3 leds , momentary tactile button. red led on digital 12, yellow on 11,green on 10 , button on 2. have set button high , when pressed goes low. not sure if pull or down. not sure if best method works. can whole thing simple things turn leds on or off or cycle through modes blink or wave or bounce. have been reading magazines, books, web articles, blogs, forums , can find , still cant find examples of need. ok have established have no problems building circuits , no problem researching, here need.
here terrible pseudo code
green on
then
yellow on
then
red on
for ill 5 seconds between each, more hour.
if yellow or red on
and if button = low (pressed)
then start over.
i have been @ week trying can find. if use delays each sequence doesnt read button unpressed until done going through green, yellow, red. understant interrupt on global scale dont wanna use because add movement thing. want light scheme independant else, way 3 light , button own function , has nothing servos or bumper switches or speakers or else. please if can great.
here terrible pseudo code
green on
then
yellow on
then
red on
for ill 5 seconds between each, more hour.
if yellow or red on
and if button = low (pressed)
then start over.
i have been @ week trying can find. if use delays each sequence doesnt read button unpressed until done going through green, yellow, red. understant interrupt on global scale dont wanna use because add movement thing. want light scheme independant else, way 3 light , button own function , has nothing servos or bumper switches or speakers or else. please if can great.
here terrible pseudo code
actual code help. or don't have that?
quote
i can whole thing simple things turn leds on or off or cycle through modes blink or wave or bounce.
so have code?
here's how multiple things:
http://www.gammon.com.au/blink
Arduino Forum > Using Arduino > LEDs and Multiplexing > 3 leds and a button, thought it was going to be simple.
arduino
Comments
Post a Comment