Control a Raspberry Pi GPIO with Python
28 March 2021
Updated: 03 September 2023
Circuit Diagram
This script will make use of the GPIO Pins to flicker an LED
The circuit diagram is below:
I’ve used a resistor for the resistor connected in series , however the resistance for a given LED can be calculated with this equation (From Circuit Specialists):
It’s important to connect the LED in the correct direction on the circuit
Code
Below is a simple python script which will handle turning the GPIO pins on and off using the RPi.GPIO library