by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Revision 0:044febc0d117, committed 2012-08-31
- Comitter:
- robt
- Date:
- Fri Aug 31 16:07:15 2012 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 044febc0d117 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Aug 31 16:07:15 2012 +0000 @@ -0,0 +1,10 @@ +/*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% +} +
diff -r 000000000000 -r 044febc0d117 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Aug 31 16:07:15 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file