Riko Tandil
/
Nucleo_blink_led_jy
Blink LED
main.cpp@1:65712b489c3e, 2017-02-27 (annotated)
- Committer:
- johanyapson
- Date:
- Mon Feb 27 09:26:36 2017 +0000
- Revision:
- 1:65712b489c3e
- Parent:
- 0:39f39b8a8242
revision 2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rtandil | 0:39f39b8a8242 | 1 | #include "mbed.h" |
rtandil | 0:39f39b8a8242 | 2 | |
johanyapson | 1:65712b489c3e | 3 | DigitalOut myled(D2); |
rtandil | 0:39f39b8a8242 | 4 | |
rtandil | 0:39f39b8a8242 | 5 | int main() { |
rtandil | 0:39f39b8a8242 | 6 | while(1) { |
rtandil | 0:39f39b8a8242 | 7 | myled = 1; // LED is ON |
rtandil | 0:39f39b8a8242 | 8 | wait(0.2); // 200 ms |
rtandil | 0:39f39b8a8242 | 9 | myled = 0; // LED is OFF |
rtandil | 0:39f39b8a8242 | 10 | wait(1.0); // 1 sec |
rtandil | 0:39f39b8a8242 | 11 | } |
rtandil | 0:39f39b8a8242 | 12 | } |