Arduino Switch/Case w/RGB LED example

Here is a recent example I made for a student-led lecture in computation class. The topics I had to present were RGB LEDs and Switch/Case logic. To demonstrate this, I created an Arduino sketch that takes input from 3 push buttons and counts how many are pressed. Based on this input it changes the RGB LED to either red, blue, or green. I also learned a lot about button input with microcontrollers while creating this simple example. I have previously only worked with switches from a basic electronic standpoint and not as an input. I quickly discovered the need for pull-up or pull-down resistors on each button in order to get clear and accurate readings.


Switch/Case with RGB LEDs from Steve Varga on Vimeo.



Tags: , , ,
This entry was posted on Friday, February 27th, 2009 at 12:52 am and is filed under Classes, Computation. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.