We will be altering proposed design #5 into something a bit different and more creative. We will still have the RGB LED fading through all of the different colors, but we will also implement a tilt switch so that, when it is tilted, the order of the colors flip. If the order of colors starts in the traditional rainbow order, the tilt switch will reverse the rainbow (red to orange to yellow etc. becomes yellow to orange to red).
First, we need to set up the system for the lights. We are using generic LED lights for the fading effect and have other components, such as the tilt switch, resistor, and jumper wires, which are all hooked onto the breadboard and/or the Launchpad. The Launchpad is then connected to the computer through USB so that we can program it.
In order to program this, we used Energia and linked it up to the Launchpad. We started by setting up the pinmodes for the LED lights and initializing their variables. We made a main fade loop for all of the colors, where we had to accommodate for whether or not the tilt switch is tilted or not and control the LED values and fade speed.
With both the Launchpad and coding complete, we will be able to see a change in the fade of LED colors with just the tilt of a tilt switch.










_NUySOEZIam.png)

Comments