Pages: [1]   Go Down
Author Topic: LED-Blinker  (Read 645 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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;)]
Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 118
Posts: 4553
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-razz I hope it makes at least some sens to you smiley
Logged

Sugar Grove, Illinois USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is in English too...

Look at Sparkfun Inventors kit.

This should be a link to the booklet that comes with the kit.
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Boards/ARDX-EG-SPAR-WEB-REV10.pdf

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





Logged

Pages: [1]   Go Up
Jump to: