An LED (light emitting diode) is a semiconductor device that emits light when electric current passes through it. When electrons flow through the diode, they lose energy and release photons of light. The color of the light depends on the energy level of the emitted photons. LEDs require 1.5-2.5 volts and around 10 milliamps of current to operate, and a resistor is used to prevent overloading the LED. Basic programs can be written to control an LED by setting pins as outputs and pulsing them high and low to turn the LED on and off.