Managing a servo motor
To show you how to use a PWM generator in order to manage a peripheral, we can use a servo motor. This is a really simple motor where we can set a specific gear position by setting a proper duty-cycle of the PWM signal (another example of how to use a PWM in order to generate a clock signal has been reported in the Using an external controller section, in Chapter 14, Controller Area Network - CAN, and the Detecting a gas section, in Chapter 17, Analog-to-Digital Converters - ADC ).
In the following image, you can see the servo motor used in this example:
Note
The device can be purchased at http://www.cosino.io/product/nano-servo-motor ...
Get GNU/Linux Rapid Embedded Programming 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.