Pages: [1]   Go Down
Author Topic: help with LED Button sketch  (Read 568 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok well right now im still bouncing around ideas so i dont have any code written but i want to write up a sketch that will enable me to switch between different modes. in one mode i will be able to press a button and have an LED light up the button with a certain color. in another mode i want to be able to make the LED change colors so that the button seems to be changing colors. i want to be able to hold down a button or two for a certain amount of time so that the arduino knows that i want to switch modes but i dont know how i would write that. any help?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could use PulseIn command.
http://arduino.cc/en/Reference/PulseIn

Or multiple If sentences.
As far as LED goes use an RBG LED.
Logged

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

Start at the beginning; look at some of the examples of how to fade a single LED.
Look at how to accept button presses, then merge.
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.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know all of these basic things already but what i want to be able to do is just change the mode at any given time and not just at start up so how would i loop that?
Logged

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

Quote
but what i want to be able to do is just change the mode at any given time and not just at start up so how would i loop that

You would put your code in "loop".

Why don't you show us your code, and we can help you from there.
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: