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:157c302566e8, 2018-07-26 (annotated)
- Committer:
- hezhian
- Date:
- Thu Jul 26 04:57:20 2018 +0000
- Revision:
- 0:157c302566e8
??????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| hezhian | 0:157c302566e8 | 1 | #include "mbed.h" |
| hezhian | 0:157c302566e8 | 2 | |
| hezhian | 0:157c302566e8 | 3 | //------------------------------------ |
| hezhian | 0:157c302566e8 | 4 | // Hyperterminal configuration |
| hezhian | 0:157c302566e8 | 5 | // 9600 bauds, 8-bit data, no parity |
| hezhian | 0:157c302566e8 | 6 | //------------------------------------ |
| hezhian | 0:157c302566e8 | 7 | |
| hezhian | 0:157c302566e8 | 8 | Serial pc(PA_9, PA_10); |
| hezhian | 0:157c302566e8 | 9 | DigitalIn sw(PB_1); |
| hezhian | 0:157c302566e8 | 10 | |
| hezhian | 0:157c302566e8 | 11 | int main() |
| hezhian | 0:157c302566e8 | 12 | { |
| hezhian | 0:157c302566e8 | 13 | int i = 1; |
| hezhian | 0:157c302566e8 | 14 | pc.printf("Hello World !\n"); |
| hezhian | 0:157c302566e8 | 15 | while(1) { |
| hezhian | 0:157c302566e8 | 16 | wait(0.1); |
| hezhian | 0:157c302566e8 | 17 | if (sw.read() == 0) |
| hezhian | 0:157c302566e8 | 18 | { |
| hezhian | 0:157c302566e8 | 19 | |
| hezhian | 0:157c302566e8 | 20 | pc.printf("This program runs since %d seconds.\n", i++); |
| hezhian | 0:157c302566e8 | 21 | } |
| hezhian | 0:157c302566e8 | 22 | } |
| hezhian | 0:157c302566e8 | 23 | } |