Author Options:

Arduino Code for LEDs Answered

I am trying to get it to work so one button turns on and off the lights and then another button that switches one set of lights on then when pressed turns those off and puts on another set on. Basically one set of yellow lights on then when the button is pressed they turn off and the red lights go on.



3 years ago

Starting with a flowchart like the one rickharris is a good way to get a good idea of what you want to program.

What you want to do is very simple and you should be able to learn how to have something react to a button press from the examples within the arduino software.

Electronics side: Be sure to keep in mind that a arduino pin can't power many leds.


3 years ago

Start by writing down a flow chart for what you want to happen and when - a linear plan of actions. (see my instructable link below)

Set out a table showing the Inputs and out puts

From these 2 if you know the commands necessary it is easy to get your program working.