Thanks for the reply. I don't understand most of it, but want to see if I can parse. Thanks for your patience!
The Pi is rather short on hardware specs for its GPIO pins (due to Broadcom's NDA policy), but they can be programmed for various output drive strengths up to 16mA and various people who have seen the Broadcom data say 17mA should be regarded as the upper limit. Unless your LED Vf is up around 2.2-2.4V or higher, you are almost certainly overloading the GPIO driving the LED.
I calculated the resistor I'm using for the LED circuit using 3.3V supply voltage (assuming this is what the GPIO pin outputs when it's high?), 2.2V voltage drop across the green LED, and 20mA LED current. My math gave me a 55ohm resistor, but I only had a 56. If I'm understanding what you're saying, I shouldn't use more than 16-17mA for the LED current? That gives me 73ohms for the resistor. I'll try that when I get home. I'd like to understand the "why", though. Am I just pulling too much current from the GPIO pin for a Pi? Does that lead to instability, etc?
Its also worth noting that the total extras current from the 3.3V rail INCLUDING all current sourced by high GPIOs needs to be kept under 50mA.
If I'm reading correctly, I wouldn't want to drive 4 different LEDs simultaneously at 15mA? That seems really limiting! Is that the point at which I would power the LEDs off a different power supply and use the GPIO pin to just switch the power on/off to the LEDs?
Use of logic buffers between the PI and any indicators (LEDs etc.) is strongly recommended.
A quick search didn't bring anything up that made it clear why, other than for circuit protection of the Pi. Is this just a best practice to make sure that something doesn't get wired awry that causes current to flow back into the input pin? Or is this something that would fix the problem I'm having with the switch?
Thanks!
Ryan