Go Down

Topic: Coding help! (Read 548 times) previous topic - next topic

New to the Arduino software.
The Board we are using is the LilyPad Arduino w/ ATMega328.
We have 6 LEDs (3 red and 3 green) and a button.
We're trying to get the 3 red LEDs to light up when the button is clicked once, and if the button is pressed for more than 2 seconds, the green LEDs should light up.

We need the coding please! This is our first project and we need a jump start as time is low

Jack Christensen


We're trying to get the 3 red LEDs to light up when the button is clicked once, and if the button is pressed for more than 2 seconds, the green LEDs should light up.


Is that the extent of it?  Do any LEDs ever go off?
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

jraskell


We need the coding please! This is our first project and we need a jump start as time is low


That's not really what this forum is for.  It's for helping people with particular problems with their code, not providing code for them.  See this post: (sticky) http://arduino.cc/forum/index.php/topic,97455.0.html  In particular, items 6 and 10.

That being said, the Arduino already provides a fairly comprehensive set of example sketches showing basic functionality of nearly all it's features.  Spend a few minutes looking through them, and you'll likely find a lot of what you're looking for.

CrossRoads

Go do some reading in the Learning section. Start with declaring IO pin, setting them up as inputs & outputs,
add Debounce of a button, then add checking for time passage using millis.
What you are after is pretty basic.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

AWOL

@OP
To save your inevitable embarrassment,  I've deleted your duplicate cross-postings.
Cross-posting wastes time, and I'm sure you wouldn't want that.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up