quentin godbert
/
t2-stm32-lift
interrupt géré compil ok sans isr
Fork of T2_STM32 by
main.cpp@0:c365c76c11c3, 2017-12-22 (annotated)
- Committer:
- Tioneb
- Date:
- Fri Dec 22 14:36:12 2017 +0000
- Revision:
- 0:c365c76c11c3
- Child:
- 1:979edb6d1559
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Tioneb | 0:c365c76c11c3 | 1 | #include "mbed.h" |
Tioneb | 0:c365c76c11c3 | 2 | |
Tioneb | 0:c365c76c11c3 | 3 | //SAVE_TEST |
Tioneb | 0:c365c76c11c3 | 4 | |
Tioneb | 0:c365c76c11c3 | 5 | PwmOut mypwm(PWM_OUT); |
Tioneb | 0:c365c76c11c3 | 6 | |
Tioneb | 0:c365c76c11c3 | 7 | DigitalOut myled(LED1); |
Tioneb | 0:c365c76c11c3 | 8 | |
Tioneb | 0:c365c76c11c3 | 9 | int main() { |
Tioneb | 0:c365c76c11c3 | 10 | |
Tioneb | 0:c365c76c11c3 | 11 | mypwm.period_ms(10); |
Tioneb | 0:c365c76c11c3 | 12 | mypwm.pulsewidth_ms(1); |
Tioneb | 0:c365c76c11c3 | 13 | |
Tioneb | 0:c365c76c11c3 | 14 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
Tioneb | 0:c365c76c11c3 | 15 | |
Tioneb | 0:c365c76c11c3 | 16 | while(1) { |
Tioneb | 0:c365c76c11c3 | 17 | myled = !myled; |
Tioneb | 0:c365c76c11c3 | 18 | wait(1); |
Tioneb | 0:c365c76c11c3 | 19 | } |
Tioneb | 0:c365c76c11c3 | 20 | } |