vissarut prakobpon
/
project_ZIGBEE
ZIGBEE project
main.cpp@0:2c78d0207461, 2017-05-15 (annotated)
- Committer:
- 3ecauz
- Date:
- Mon May 15 03:44:58 2017 +0000
- Revision:
- 0:2c78d0207461
ZIGBEE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
3ecauz | 0:2c78d0207461 | 1 | #include "mbed.h" |
3ecauz | 0:2c78d0207461 | 2 | |
3ecauz | 0:2c78d0207461 | 3 | PwmOut mypwm(PWM_OUT); |
3ecauz | 0:2c78d0207461 | 4 | |
3ecauz | 0:2c78d0207461 | 5 | DigitalOut myled(LED1); |
3ecauz | 0:2c78d0207461 | 6 | |
3ecauz | 0:2c78d0207461 | 7 | int main() { |
3ecauz | 0:2c78d0207461 | 8 | |
3ecauz | 0:2c78d0207461 | 9 | mypwm.period_ms(10); |
3ecauz | 0:2c78d0207461 | 10 | mypwm.pulsewidth_ms(1); |
3ecauz | 0:2c78d0207461 | 11 | |
3ecauz | 0:2c78d0207461 | 12 | printf("pwm set to %.2f %%\n", mypwm.read() * 100); |
3ecauz | 0:2c78d0207461 | 13 | |
3ecauz | 0:2c78d0207461 | 14 | while(1) { |
3ecauz | 0:2c78d0207461 | 15 | myled = !myled; |
3ecauz | 0:2c78d0207461 | 16 | wait(1); |
3ecauz | 0:2c78d0207461 | 17 | } |
3ecauz | 0:2c78d0207461 | 18 | } |