hello added to test
source/main.cpp@2:b5e7d3054ea2, 2019-05-21 (annotated)
- Committer:
- malavikasaji
- Date:
- Tue May 21 18:05:26 2019 +0000
- Revision:
- 2:b5e7d3054ea2
- Parent:
- 1:0c3d41de500f
hello added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ssmith73 | 0:2d379ca05c9d | 1 | #include "mbed.h" |
ssmith73 | 0:2d379ca05c9d | 2 | |
ssmith73 | 0:2d379ca05c9d | 3 | Serial pc(USBTX, USBRX); // tx, rx |
ssmith73 | 0:2d379ca05c9d | 4 | DigitalOut awakeSignal(LED4); |
ssmith73 | 0:2d379ca05c9d | 5 | DigitalOut led1(LED1); |
ssmith73 | 0:2d379ca05c9d | 6 | |
ssmith73 | 0:2d379ca05c9d | 7 | #define SLEEP_TIME 500 // (msec) |
ssmith73 | 0:2d379ca05c9d | 8 | |
ssmith73 | 0:2d379ca05c9d | 9 | // main() runs in its own thread in the OS |
ssmith73 | 0:2d379ca05c9d | 10 | int main() |
ssmith73 | 0:2d379ca05c9d | 11 | { |
ssmith73 | 0:2d379ca05c9d | 12 | awakeSignal = 1; |
ssmith73 | 0:2d379ca05c9d | 13 | pc.printf("Hello World!"); |
ssmith73 | 0:2d379ca05c9d | 14 | while (true) { |
ssmith73 | 0:2d379ca05c9d | 15 | // Blink LED and wait 0.5 seconds |
ssmith73 | 0:2d379ca05c9d | 16 | led1 = !led1; |
ssmith73 | 0:2d379ca05c9d | 17 | wait_ms(SLEEP_TIME); |
ssmith73 | 0:2d379ca05c9d | 18 | } |
ssmith73 | 0:2d379ca05c9d | 19 | } |
malavikasaji | 1:0c3d41de500f | 20 | // testing code release process. |