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@2:20e20cfae75e, 2020-04-27 (annotated)
- Committer:
- namcheol
- Date:
- Mon Apr 27 08:02:20 2020 +0000
- Revision:
- 2:20e20cfae75e
- Parent:
- 1:89d23c8072af
- Child:
- 3:1c8ab6d6af18
lab04-uart-tx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dshin | 0:f31836d48420 | 1 | #include "mbed.h" |
dshin | 0:f31836d48420 | 2 | |
namcheol | 2:20e20cfae75e | 3 | Serial uart_tx(D1, D0); //D1 = tx, D0 = rx |
namcheol | 2:20e20cfae75e | 4 | DigitalIn sw(D2, PullDown); |
dshin | 0:f31836d48420 | 5 | |
dshin | 0:f31836d48420 | 6 | int main() |
dshin | 0:f31836d48420 | 7 | { |
namcheol | 2:20e20cfae75e | 8 | while(true) { |
namcheol | 2:20e20cfae75e | 9 | if(sw == 1) { |
namcheol | 2:20e20cfae75e | 10 | uart_tx.putc('1'); |
namcheol | 2:20e20cfae75e | 11 | thread_sleep_for(200); |
namcheol | 1:89d23c8072af | 12 | } |
dshin | 0:f31836d48420 | 13 | } |
dshin | 0:f31836d48420 | 14 | } |