Pages: [1]   Go Down
Author Topic: Coding help!  (Read 419 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3965
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

New Hampshire
Offline Offline
God Member
*****
Karma: 17
Posts: 781
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26442
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25775
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
Logged

"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.

Pages: [1]   Go Up
Jump to: