adam&chuang
/
IMU_Aq
compiled unsuccessful
Fork of IMU_Aq by
main.cpp@0:2c03c9f00e49, 2016-02-19 (annotated)
- Committer:
- adam_z
- Date:
- Fri Feb 19 09:52:24 2016 +0000
- Revision:
- 0:2c03c9f00e49
- Child:
- 1:92e66f3dbb78
compiled unsuccessful;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adam_z | 0:2c03c9f00e49 | 1 | #include "mbed.h" |
adam_z | 0:2c03c9f00e49 | 2 | |
adam_z | 0:2c03c9f00e49 | 3 | PwmOut mypwm(PWM_OUT); |
adam_z | 0:2c03c9f00e49 | 4 | |
adam_z | 0:2c03c9f00e49 | 5 | DigitalOut myled(LED1); |
adam_z | 0:2c03c9f00e49 | 6 | |
adam_z | 0:2c03c9f00e49 | 7 | int main() { |
adam_z | 0:2c03c9f00e49 | 8 | |
adam_z | 0:2c03c9f00e49 | 9 | mypwm.period_ms(10); |
adam_z | 0:2c03c9f00e49 | 10 | mypwm.pulsewidth_ms(1); |
adam_z | 0:2c03c9f00e49 | 11 | |
adam_z | 0:2c03c9f00e49 | 12 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
adam_z | 0:2c03c9f00e49 | 13 | |
adam_z | 0:2c03c9f00e49 | 14 | while(1) { |
adam_z | 0:2c03c9f00e49 | 15 | myled = !myled; |
adam_z | 0:2c03c9f00e49 | 16 | wait(1); |
adam_z | 0:2c03c9f00e49 | 17 | } |
adam_z | 0:2c03c9f00e49 | 18 | } |