CHAPTER 7

image

Pulse Width Modulation

The Raspberry Pi has two Pulse Width Modulation (PWM) peripherals available for the end user. The PWM peripheral is surprisingly complex, but the complexity is largely due to its flexibility.

To experiment with the PWM peripherals, the pipwm command has been provided as part of this book’s included software. This saves us from having to write programs and provides a tool for your general use.

The pipwm Command

If you installed the book’s provided software, the pipwm command should be immediately available as follows:

$ pipwm -hUsage: pipwm [-options]where:      -A { a | p }  Use PWM algorithm or MS (MS is default) ...

Get Exploring the Raspberry Pi 2 with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.