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

Visualizing software and hardware-timed PWM

Our code examples from the previous sections, Using PWM to control an LED, and Visually exploring PWM with PiScope, both created a PWM signal using your Raspberry Pi's PWM hardware. Accompanying the code for this chapter and listed in the following table are alternative implementations that demonstrate the use of hardware-timed and software-generated PWM signals. You may recall that we discussed these alternatives back in the section entitled Creating PWM signals:

File

Details

pwm_hardware.py

This is hardware PWM using PiGPIO (this is the code we've seen in this chapter). You must use a PWM hardware GPIO pin 12, 13, 18, or 19.

pwm_hardware_timed.py

This is a hardware-timed PWM using PiGPIO. This will work with any GPIO pin.

pwm_software.py

This is software PWM using RPi.GPIO (PiGPIO does not provide software PWM). This will work with any GPIO pin.

 

Functionally...

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