We are now ready to investigate our first blinking method using the GPIOZero library. You will find the code we are about to cover in the chapter02/led_gpiozero.py file. Please review this file before proceeding.
In the Further reading section, you will find relevant links to the GPIOZero API documentation for the specific features of this library that we use in this section.
We will start by running our example code.
Run the program using the following command, remembering that you need to be in the activated virtual environment (if you need a refresher on how to activate a Python virtual environment, see Chapter 1, Setting Up Your Development Environment):
(venv) $ python led_gpiozero.py
If the LED is connected correctly, it should blink.
If you receive an error about PiGPIO when you run the program, make sure you have enabled the pigpio daemon as outlined in Chapter 1, Setting Up Your Development Environment. We'll...