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: Arduino, Buttons, RGB LED, Switch/Case