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