Ok, so after messing around with the RGB LED for a good two hours, I’ll report my results:

“If you are using a common ANODE LED instead of common CATHODE, connect the long pin to +5 instead of ground”

so.. connecting it to ground as we do with the others won’t work, also, if I write LOW to a pin will turn the LED on and if I write HIGH, that will turn it off. Oh yeah, and all 3 inputs use the same ground (which is actually 5V). Hopefully at some point in class we can delve deeper into why I can’t get it to listen to me, no matter what I do. 

So, here is something I managed to get to work much earlier in the night:

the RGBlink!


The red wires connect the red switch and LED, the green to the green, the blue to the blue. Pressing the switch makes the LED blink, pressing both switches makes both blink, etc. If all 3 are pressed, the LEDs will blink in order starting from whichever was pressed first. I used the two tiny button switches and one that I soldered earlier this week. Here is the code:



UPDATE::::: after learning a bit more about cathodes and anodes, I figured out that we have a common anode LED, so the long leg from the LED should always lead to 5v, and passing a value of 0 through the LED turns it on (while passing 255 will turn it off) so it is a little counter-intuitive. And on a frustrating, though less important note, the leg order is: R(Anode)BG, not RGB like I thought.

I borrowed this RGB blink code from an instuctable and added an switch+if statement:



it still didn’t work 100% as I expected, but I figured you guys might like the blinky LED


Leave a Reply