If you look at the code for the GPIOZero example, it's pretty obvious we're making an LED blink—it's pretty explicit in the code. But what about the PiGPIO example? There is no mention of LEDs or blinking. In truth, it could be doing anything—it's just we know an LED is connected to GPIO 21.
Our two blinking examples reveal important aspects of GPIOZero and PiGPIO:
-
GPIOZero is a higher-level wrapper library. On the surface, it abstracts common electronic components such as LEDs into simple-to-use classes while, underneath, it is delegating the actual interfacing work to a concrete GPIO library.
-
PiGPIO is a lower-level GPIO library where you work with, control, and access GPIO pins directly.
The "zero" in GPIOZero refers to a naming convention for zero boilerplate code libraries where all of the complex internals are abstracted away to make it easier for beginners to get started...