信長 平良
/
Serial_test
mbedをシリアル通信のクッションにするだけのプログラムです。
Diff: main.cpp
- Revision:
- 0:1315a1939004
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Aug 12 00:06:52 2014 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +Serial gps(p9,p10); +void gpsRx() { + char ch; + ch = pc.getc(); + gps.putc(ch); +} +void pcRx(){ + char ch; + ch = gps.getc(); + pc.putc(ch); + } +int main() { + pc.baud(4800); + gps.baud(4800); + pc.attach(gpsRx, Serial::RxIrq); + gps.attach(pcRx, Serial::RxIrq); + while (1) { + } +} +/* +int main(){ + while(1){ + pc.putc(gps.getc()) ; + } +}*/