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.
Dependencies: mbed
main.cpp@1:c373f768ba41, 2021-05-17 (annotated)
- Committer:
- falconsyunya
- Date:
- Mon May 17 11:28:46 2021 +0000
- Revision:
- 1:c373f768ba41
- Parent:
- 0:654a49387753
2021/05/17
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
falconsyunya | 1:c373f768ba41 | 1 | //シリアルモニタに入力した文字をマイコンを介してIM920に送る&IM920で受信したデータをマイコンを介してシリアルモニタに送る. |
falconsyunya | 1:c373f768ba41 | 2 | //シリアルモニタのボーレートは38400以上で. |
falconsyunya | 0:654a49387753 | 3 | #include "mbed.h" |
falconsyunya | 0:654a49387753 | 4 | int main() |
falconsyunya | 0:654a49387753 | 5 | { |
falconsyunya | 0:654a49387753 | 6 | Serial pc(USBTX, USBRX,38400);//ボーレートを落とすと,USB側からのデータが正確に出力されない. |
falconsyunya | 0:654a49387753 | 7 | Serial uart(PA_9,PA_10,19200);//TX(IM920_RX), RX(IM920_TX) |
falconsyunya | 0:654a49387753 | 8 | |
falconsyunya | 0:654a49387753 | 9 | while(1) { |
falconsyunya | 1:c373f768ba41 | 10 | if(pc.readable())uart.putc(pc.getc());//pcから入力アリ⇒pcからの入力get⇒uartに出力 |
falconsyunya | 1:c373f768ba41 | 11 | if(uart.readable())pc.putc(uart.getc());//uartから入力アリ⇒uartからの入力get⇒pcに出力 |
falconsyunya | 0:654a49387753 | 12 | } |
falconsyunya | 0:654a49387753 | 13 | |
falconsyunya | 0:654a49387753 | 14 | } |