This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
|
oak:tutorials:rgb-led [2016/03/23 22:19] jwhendy [Circuit] added picture |
oak:tutorials:rgb-led [2016/03/23 23:17] jwhendy [Components used] |
||
|---|---|---|---|
| Line 12: | Line 12: | ||
| |Jumper wires | 4 | | | |Jumper wires | 4 | | | ||
| |RGB LED| 1 | whitish LED with 4 leads, one longer than the others | | |RGB LED| 1 | whitish LED with 4 leads, one longer than the others | | ||
| + | |Resistor, 220 ohm| 3 | Red-Red-Brown| | ||
| + | |||
| + | **Note:** 220 ohms is a ballpark recommendation; acceptable values are between 100 - 1k ohms. | ||
| ===== Concepts ===== | ===== Concepts ===== | ||
| Line 84: | Line 87: | ||
| You should see each color pulse, one at a time, each over the course of ~2 seconds. | You should see each color pulse, one at a time, each over the course of ~2 seconds. | ||
| + | |||
| + | [[http://digistump.com/wiki/_media/oak-rgb-led-cycle.gif|{{http://digistump.com/wiki/_media/oak-rgb-led-cycle.gif?400}}]] | ||
| === Code: fading through the rainbow === | === Code: fading through the rainbow === | ||
| Line 157: | Line 162: | ||
| We ramp up the red channel of the LED, and when it's halfway through (when ''i = 500''), the green channel begins ramping up. At ''i = 1000'', the red channel is fully on, green is halfway to full on, and blue is just starting. They start and stop the process approximately half a second offset from each other, and once they're all at full brightness, the process reverses to bring them back down to off. | We ramp up the red channel of the LED, and when it's halfway through (when ''i = 500''), the green channel begins ramping up. At ''i = 1000'', the red channel is fully on, green is halfway to full on, and blue is just starting. They start and stop the process approximately half a second offset from each other, and once they're all at full brightness, the process reverses to bring them back down to off. | ||
| - | Here's what you will see with the code above! | + | Here's what you will see with the code above! It's a bit hard to make out, but the progression is red, yellow, white, cyan, blue. |
| + | |||
| + | [[http://digistump.com/wiki/_media/oak/tutorials/oak-rgb-led-rainbow.gif|{{http://digistump.com/wiki/_media/oak/tutorials/oak-rgb-led-rainbow.gif?400}}]] | ||
| ===== Conclusion ===== | ===== Conclusion ===== | ||