description
Dependencies: mbed
main.cpp@0:1c036bafbcc7, 2016-09-28 (annotated)
- Committer:
- mikteam10
- Date:
- Wed Sep 28 09:12:08 2016 +0000
- Revision:
- 0:1c036bafbcc7
v1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mikteam10 | 0:1c036bafbcc7 | 1 | #include "mbed.h" |
mikteam10 | 0:1c036bafbcc7 | 2 | |
mikteam10 | 0:1c036bafbcc7 | 3 | //------------------------------------ |
mikteam10 | 0:1c036bafbcc7 | 4 | // Hyperterminal configuration |
mikteam10 | 0:1c036bafbcc7 | 5 | // 9600 bauds, 8-bit data, no parity |
mikteam10 | 0:1c036bafbcc7 | 6 | //------------------------------------ |
mikteam10 | 0:1c036bafbcc7 | 7 | |
mikteam10 | 0:1c036bafbcc7 | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
mikteam10 | 0:1c036bafbcc7 | 9 | |
mikteam10 | 0:1c036bafbcc7 | 10 | DigitalOut myled(LED1); |
mikteam10 | 0:1c036bafbcc7 | 11 | |
mikteam10 | 0:1c036bafbcc7 | 12 | int main() { |
mikteam10 | 0:1c036bafbcc7 | 13 | int i = 1; |
mikteam10 | 0:1c036bafbcc7 | 14 | pc.printf("Hello World !\n"); |
mikteam10 | 0:1c036bafbcc7 | 15 | while(1) { |
mikteam10 | 0:1c036bafbcc7 | 16 | wait(1); |
mikteam10 | 0:1c036bafbcc7 | 17 | pc.printf("This program runs since %d seconds.\n", i++); |
mikteam10 | 0:1c036bafbcc7 | 18 | myled = !myled; |
mikteam10 | 0:1c036bafbcc7 | 19 | } |
mikteam10 | 0:1c036bafbcc7 | 20 | } |
mikteam10 | 0:1c036bafbcc7 | 21 |