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:38795d2d6790, 2020-10-28 (annotated)
- Committer:
- aoi_tech
- Date:
- Wed Oct 28 01:35:48 2020 +0000
- Revision:
- 0:38795d2d6790
ASCII output
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| aoi_tech | 0:38795d2d6790 | 1 | #include "mbed.h" |
| aoi_tech | 0:38795d2d6790 | 2 | |
| aoi_tech | 0:38795d2d6790 | 3 | Serial pc(USBTX,USBRX); |
| aoi_tech | 0:38795d2d6790 | 4 | |
| aoi_tech | 0:38795d2d6790 | 5 | int main() |
| aoi_tech | 0:38795d2d6790 | 6 | { |
| aoi_tech | 0:38795d2d6790 | 7 | pc.baud(9600); |
| aoi_tech | 0:38795d2d6790 | 8 | int val = 0; |
| aoi_tech | 0:38795d2d6790 | 9 | int days = 0; |
| aoi_tech | 0:38795d2d6790 | 10 | while(true){ |
| aoi_tech | 0:38795d2d6790 | 11 | val = pc.readable(); |
| aoi_tech | 0:38795d2d6790 | 12 | if(val == 1){ |
| aoi_tech | 0:38795d2d6790 | 13 | days = pc.getc(); |
| aoi_tech | 0:38795d2d6790 | 14 | pc.printf("%d\n\r",days); |
| aoi_tech | 0:38795d2d6790 | 15 | } |
| aoi_tech | 0:38795d2d6790 | 16 | } |
| aoi_tech | 0:38795d2d6790 | 17 | } |