Blinking LED with Raspberry Pi using python

Learn Blinking LED with Raspberry Pi. Learn the working with GPIO (General Purpose Input Output) pins in Raspberry Pi. Currently, we are using Raspberry Pi 3 Model B Board. So, let’s start.

Step 1: Required Components

LED (generic) x 1
Breadboard x 1
Raspberry Pi Board x 1
220 Ω  Resistor x 1
Jumper Wires

Step 2: Circuit Time

Circuit of Blinking LED with Raspberry Pi
Make a circuit as per the given diagram. Connect the LED to GPIO 17 Pin of Raspberry PI. The LED will turn on and off at certain time interval.


Step 3: Code Time

This is the code for Blinking LED with Raspberry PI. First imported GPIO and Time Library. Set the GPIO 17 as an output pin. In while loop, GPIO is set to high, delay for a second, set the pin to low and delay for a second.

Step 4: Run code to Raspberry Pi

Run the Python program in your Raspberry Pi after setting components as per circuit diagram. The LED will turn on and off.

For running python code in Raspberry PI, visit: raspberrypi.org/documentation/usage/python/

For basic hardware information about Raspberry PI 3, Click here.

Leave a Reply