You are viewing an older revision! See the latest version
Pulse Width Modulation
All exercises in this topic will be carried out using an mbed application board. mbed uses pins p21 to p26 for use with a PwmOut class. On mbed application board pins p21 and p22 are connected to a servo motor headers, pins p23, p24 and p25 are connected to a RGB LED, and p26 is connected to a speaker.
Exercise 1: Generating PWM signals¶
Create a PWM signal which can be seen on an oscilloscope. Set the frequency of the PWM signal to 1 kHz. Set the initial duty cycle to 50%.