Chapter 6. PWM – Writing Analog Information
In the previous chapter, we read information from analog sensors. It is time to write information on analog devices like motors. Writing analog information is not that straightforward. The BeagleBone processor has a Pulse Width Modulation (PWM) subsystem that can write analog information on some specific GPIO pins. In this chapter, we will learn how PWM works and how it can be used to interface analog output devices. Then we will write a program to fade an LED and drive a servo motor using PWM. In this chapter, will cover the following topics:
What is PWM?
BeagleBone's PWM
Writing on analog components
Fading LED circuit setup
Program to fade in and fade out an LED
Micro servo motor circuit setup
Program to control micro servo motor