Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@0:fd080fb55bae, 2015-10-06 (annotated)
- Committer:
- jiteshg
- Date:
- Tue Oct 06 22:09:22 2015 +0000
- Revision:
- 0:fd080fb55bae
- Child:
- 1:8c73948a0864
Using pwn library to create a 50Hz (20ms period) square wave
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jiteshg | 0:fd080fb55bae | 1 | #include "mbed.h" |
jiteshg | 0:fd080fb55bae | 2 | PwmOut pwm1(p21); |
jiteshg | 0:fd080fb55bae | 3 | |
jiteshg | 0:fd080fb55bae | 4 | int main() { |
jiteshg | 0:fd080fb55bae | 5 | pwm1.period_ms(20); |
jiteshg | 0:fd080fb55bae | 6 | pwm1.write(0.5); |
jiteshg | 0:fd080fb55bae | 7 | return 0; |
jiteshg | 0:fd080fb55bae | 8 | } |