Go Down

Topic: help with LED Button sketch (Read 712 times) previous topic - next topic

chickfreak24

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?

GregaG

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

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

AWOL

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

chickfreak24

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?

AWOL

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