Semiconductor light-emitting diode is a type of component which can turn electric energy into light energy via PN junctions. By wavelength, it can be categorized into laser diode, infrared light-emitting diode and visible light-emitting diode which is usually known as light-emitting diode (LED).
Diode has unidirectional conductivity, so the current flow will be as the arrow indicates in figure circuit symbol. You can only provide the anode with a positive power and the cathode with a negative. Thus the LED will light up.
An LED has two pins. The longer one is the anode, and shorter one, the cathode. Pay attention not to connect them inversely. There is fixed forward voltage drop in the LED, so it cannot be connected with the circuit directly because the supply voltage can outweigh this drop and cause the LED to be burnt. The forward voltage of the red, yellow, and green LED is 1.8 V and that of the white one is 2.6 V. Most LEDs can withstand a maximum current of 20 mA, so we need to connect a current limiting resistor in series.
The formula of the resistance value is as follows:
R = (Vsupply – VD)/I
R stands for the resistance value of the current limiting resistor, Vsupply for voltage supply, VD for voltage drop and I for the working current of the LED.
Here is the detailed introduction for the LED: LED - Wikipedia.
2.1 Hello, LED! (For MicroPython User)
2.3 Fading LED (For MicroPython User)
7.3 Alarm Siren Lamp (For MicroPython User)
7.6 Traffic Light (For MicroPython User)
7.10 Reversing Aid (For MicroPython User)
2.1 - Hello, LED! (For Arduino User)
2.3 - Fading LED (For Arduino User)
2.1 Blink LED (For Piper Make User)
2.2 Button (For Piper Make User)
2.3 Service Bell (For Piper Make User)
2.11 Reversing System (For Piper Make User)
2.13 Reaction Game (For Piper Make User)