Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

Imports

We will start our code exploration by looking at the external libraries we are importing in our Python program. They appear near the top of the source file, as shown here:

from gpiozero import Device, LED                # (1)
from gpiozero.pins.pigpio import PiGPIOFactory # (2)
from time import sleep

 The imports of interest are the following:

  • At line (1), we import the Device and LED classes from the GPIOZero package.
  • At line (2), we are importing a GPIOZero Pin Factory. This is used together with the Device class, which we'll see next.

Next, we see how to set the GPIOZero Pin Factory implementation.

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461