From the course: Raspberry Pi: GPIO

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Python and GPIO Zero control of GPIO

Python and GPIO Zero control of GPIO

From the course: Raspberry Pi: GPIO

Python and GPIO Zero control of GPIO

- [Instructor] Let's start with using Python to control the Raspberry Pi GPIO. You'll notice there are two videos dedicated to Python, this is because Python is popular and Python provides two libraries. Actually there are more than two but gpiozero and RPI.GPIO are the most popular. Now I've provided some example code that shows how to drive the binary counter with Python and gpiozero. We're looking at that right now. The main thing to remember about Python with the gpiozero library is that it focuses on buttons and LED instead of the actual GPIO pins. For example, in line eight the gpiozero library is used to create a button. The button is called reset, and it equals gpzero.button. Almost as an after thought that button is assigned to GPIO pin three, now note that this numbering is BCM numbering not board pin three. BCM pin three corresponds to GPIO board pin five. gpiozero provides some interesting additions. For…

Contents