Chapter3
Last updated
Last updated
Raspberry PI GPIO can be used to send current to LED and light it. Please note that a resister is needed to lower the current, as shown below.
As an easy experiment, let's connect a LED and a resister on a breadboard and connects them. Raspberry PI GPIO14 (3.3V) connects to one leg of LEG and Raspberry PI GND (ground) port connects to the resistor. (Refer to the pinout diagram above to find out the physical pin number -- 8 for GPIO14). The whole setup is shown below.
Caution: If you make a mistake and short circuit the two pins from the Raspberry PI, you may burn the board. So make sure the current from one pin goes through the resistor and LED and then goes back to the other pin.
The program below turns the LED on for one second and then turns off for one second. The LED flashes for five times.