Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:b0921be5eb9d, 2014-11-24 (annotated)
- Committer:
- joshchen
- Date:
- Mon Nov 24 06:17:56 2014 +0000
- Revision:
- 0:b0921be5eb9d
- Child:
- 1:9bdf91a6bf64
initial printf
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| joshchen | 0:b0921be5eb9d | 1 | #include "mbed.h" |
| joshchen | 0:b0921be5eb9d | 2 | |
| joshchen | 0:b0921be5eb9d | 3 | //------------------------------------ |
| joshchen | 0:b0921be5eb9d | 4 | // Hyperterminal configuration |
| joshchen | 0:b0921be5eb9d | 5 | // 9600 bauds, 8-bit data, no parity |
| joshchen | 0:b0921be5eb9d | 6 | //------------------------------------ |
| joshchen | 0:b0921be5eb9d | 7 | |
| joshchen | 0:b0921be5eb9d | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
| joshchen | 0:b0921be5eb9d | 9 | |
| joshchen | 0:b0921be5eb9d | 10 | DigitalOut myled(LED1); |
| joshchen | 0:b0921be5eb9d | 11 | |
| joshchen | 0:b0921be5eb9d | 12 | int main() { |
| joshchen | 0:b0921be5eb9d | 13 | int i = 1; |
| joshchen | 0:b0921be5eb9d | 14 | pc.printf("Hello World !\n"); |
| joshchen | 0:b0921be5eb9d | 15 | while(1) { |
| joshchen | 0:b0921be5eb9d | 16 | wait(1); |
| joshchen | 0:b0921be5eb9d | 17 | pc.printf("This program runs since %d seconds.\n", i++); |
| joshchen | 0:b0921be5eb9d | 18 | myled = !myled; |
| joshchen | 0:b0921be5eb9d | 19 | } |
| joshchen | 0:b0921be5eb9d | 20 | } |
| joshchen | 0:b0921be5eb9d | 21 |