LED-Blinker

Hi,
i'd like to tell you my Plan i would like to do. I've bought an arduino UNO to build an bike blinker with two buttons, if i push the first button the left LED should blink as long as i push the button again. The same with button two and LED two.

Thank you for your help already now.

[Sorry for my English, i'm German;)]

Applefreak:
Hi,
i'd like to tell you my Plan i would like to do. I've bought an arduino UNO to build an bike blinker with two buttons, if i push the first button the left LED should blink as long as i push the button again. The same with button two and LED two.

Thank you for your help already now.

What have you done so far?

Start by studying the "blink without delay" example. Expand it to make two leds blink. The two leds should blink independently from each other. Also, you should be able to change their blink times independently from each other.
All of this without touching a pushbutton.

Once you understand the non-blocking delay mechanics, you can start polling the two buttons with the same technique. You need two state variables for each led: one to tell you if the led is currently on or off, the other to tell you if it's blinking or not. When you detect a change in the button state (from not pressed to pressed), you switch the "is blinking" state variable of the corresponding led.

Hmm... too much meat probably :stuck_out_tongue: I hope it makes at least some sens to you :slight_smile:

This is in English too...

Look at Sparkfun Inventors kit.

This should be a link to the booklet that comes with the kit.

Look at pages 10 and 22 of the pdf document. (CIRC-01 Blinking LED and CIRC-07 Button Pressing - Pushbuttons)