In this project, you’ll be introduced to using the GPIO pins of your Raspberry Pi and how to integrate them with electronic components using Python.
The switch pins should easily fit into the patch points of the breadboard, if they don’t, the switch is not being positioned correctly.
from gpiozero import LED from time import sleep from gpiozero import Button button = Button(2) led = LED(25) while True: button.wait_for_press() led.on() led.off()
Your LED should now be cycling through on and off when you press the switch
Please select an option to see content specific to your location and shop online.