Volkmar Hinz
/
Nucleo_blink_led_2_3
led_2_3
main.cpp@1:c5711c7e5b46, 2017-11-19 (annotated)
- Committer:
- Hinz
- Date:
- Sun Nov 19 16:53:10 2017 +0000
- Revision:
- 1:c5711c7e5b46
- Parent:
- 0:b6ae7abdff7e
OK
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Hinz | 0:b6ae7abdff7e | 1 | #include "mbed.h" |
Hinz | 0:b6ae7abdff7e | 2 | |
Hinz | 0:b6ae7abdff7e | 3 | DigitalOut myled2(D2); |
Hinz | 0:b6ae7abdff7e | 4 | DigitalOut myled3(D3); |
Hinz | 0:b6ae7abdff7e | 5 | |
Hinz | 0:b6ae7abdff7e | 6 | int main() { |
Hinz | 1:c5711c7e5b46 | 7 | printf("Hello World from Nucleo\r\n"); |
Hinz | 0:b6ae7abdff7e | 8 | while(1) { |
Hinz | 0:b6ae7abdff7e | 9 | myled2 = 1; // LED is ON |
Hinz | 0:b6ae7abdff7e | 10 | myled3 = 0; // LED is ON |
Hinz | 0:b6ae7abdff7e | 11 | wait(0.2); // 200 ms |
Hinz | 0:b6ae7abdff7e | 12 | myled2 = 0; // LED is OFF |
Hinz | 0:b6ae7abdff7e | 13 | myled3 = 1; // LED is ON |
Hinz | 0:b6ae7abdff7e | 14 | wait(1.0); // 1 sec |
Hinz | 0:b6ae7abdff7e | 15 | } |
Hinz | 0:b6ae7abdff7e | 16 | } |