by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

main.cpp

Committer:
robt
Date:
2012-08-31
Revision:
0:044febc0d117

File content as of revision 0:044febc0d117:

/*Sets PWM source to fixed frequency and duty cycle. Observe output on oscilloscope.
                                                                   */
#include "mbed.h"
PwmOut PWM1(p21);               //create a PWM output called PWM1 on pin 21
int main()
{
    PWM1.period(0.010);	               // set PWM period to 10 ms
    PWM1=0.5;                         // set duty cycle to 50%
}