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:a4abd66c7a04, 2016-08-27 (annotated)
- Committer:
- yu10078999
- Date:
- Sat Aug 27 11:22:39 2016 +0000
- Revision:
- 0:a4abd66c7a04
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yu10078999 | 0:a4abd66c7a04 | 1 | #include "mbed.h" |
| yu10078999 | 0:a4abd66c7a04 | 2 | DigitalOut led(D2); |
| yu10078999 | 0:a4abd66c7a04 | 3 | Serial pc(USBTX, USBRX); |
| yu10078999 | 0:a4abd66c7a04 | 4 | |
| yu10078999 | 0:a4abd66c7a04 | 5 | int main(){ |
| yu10078999 | 0:a4abd66c7a04 | 6 | pc.baud(9600); |
| yu10078999 | 0:a4abd66c7a04 | 7 | while(1){ |
| yu10078999 | 0:a4abd66c7a04 | 8 | led = !led; |
| yu10078999 | 0:a4abd66c7a04 | 9 | pc.printf("\nHello World !\n"); |
| yu10078999 | 0:a4abd66c7a04 | 10 | pc.printf("\nLED pin is: "); |
| yu10078999 | 0:a4abd66c7a04 | 11 | int c=led; |
| yu10078999 | 0:a4abd66c7a04 | 12 | pc.printf("%d",c); |
| yu10078999 | 0:a4abd66c7a04 | 13 | pc.printf("\nBYE!"); |
| yu10078999 | 0:a4abd66c7a04 | 14 | wait(1); |
| yu10078999 | 0:a4abd66c7a04 | 15 | } |
| yu10078999 | 0:a4abd66c7a04 | 16 | } |