Site icon Iotguider

Blinking LED with Raspberry Pi using python

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

Step 1: Required Components

Generic LED x 1
Raspberry Pi Board x 1
Breadboard x 1
Resistors
Jumper Wires

Step 2: Circuit Time


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 a 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 a 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 the circuit diagram. The LED will turn on and off.

For running python code in Raspberry Pi, visit: raspberrypi.org/documentation/usage/python/
Learn basic hardware information of Raspberry Pi 3.

Exit mobile version