![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork test
main.cpp@0:0583c47b5640, 2016-01-12 (annotated)
- Committer:
- weisnail
- Date:
- Tue Jan 12 13:58:15 2016 +0000
- Revision:
- 0:0583c47b5640
fork test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
weisnail | 0:0583c47b5640 | 1 | #include "mbed.h" |
weisnail | 0:0583c47b5640 | 2 | |
weisnail | 0:0583c47b5640 | 3 | PwmOut mypwm(PWM_OUT); |
weisnail | 0:0583c47b5640 | 4 | |
weisnail | 0:0583c47b5640 | 5 | DigitalOut myled(LED1); |
weisnail | 0:0583c47b5640 | 6 | |
weisnail | 0:0583c47b5640 | 7 | int main() { |
weisnail | 0:0583c47b5640 | 8 | |
weisnail | 0:0583c47b5640 | 9 | mypwm.period_ms(10); |
weisnail | 0:0583c47b5640 | 10 | mypwm.pulsewidth_ms(1); |
weisnail | 0:0583c47b5640 | 11 | |
weisnail | 0:0583c47b5640 | 12 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
weisnail | 0:0583c47b5640 | 13 | |
weisnail | 0:0583c47b5640 | 14 | while(1) { |
weisnail | 0:0583c47b5640 | 15 | myled = !myled; |
weisnail | 0:0583c47b5640 | 16 | wait(1); |
weisnail | 0:0583c47b5640 | 17 | } |
weisnail | 0:0583c47b5640 | 18 | } |