What purpose does the yellow and green LEDs have on the Arduino?
The green LED is marked with ON
, and it indicates that the Arduino has power.
The yellow LED is marked L
and is just connected to pin 13. So when you set pin 13 to HIGH the LED lights up. You can however still use pin 13 for other things.
When the green LED stops shining you most likely have a short somewhere. As the short will drain all power away, so the Arduino has no power left to light the LED(s).
Also be warned that the L
LED (the one activated by pin 13) may light up if pin 13 is high-impedance (set to input), and is not connected to anything.
On my Uno, a trivial sketch like this lights up the L
LED:
void setup ()
{
} // end of setup
void loop ()
{
} // end of loop
This is because the LED is not driven directly by pin 13, but by an op-amp (U5B) which -- if the pin is configured as an input -- may pick up enough stray voltage to activate and light up the LED.
This can be confusing because you might look at your board and think "huh? I didn't command that LED to come on".
Also note that there is the TX and RX pins on Uno (orange/yellowish) are for the USB connection. When the LED labeled TX is lit up, the Arduino is transmitting data to the computer. When the RX is lit up, it is receiving data from the computer.