Jason Mishou
/
SerialTest
Test serial to raspberry pi
Fork of Serial_ex_2 by
main.cpp
- Committer:
- M15H
- Date:
- 2017-08-21
- Revision:
- 2:b18ad269066c
- Parent:
- 0:8d318218bac1
File content as of revision 2:b18ad269066c:
#include "mbed.h" #include "BufferedSerial.h" BufferedSerial *pc; BufferedSerial *pi; char c; char buffer[128]; int x; int main() { pc = new BufferedSerial(USBTX, USBRX); pi = new BufferedSerial(PB_6, PB_7); pc->baud(115200*2); pc->format(8); pc->printf("Hello World\n\r"); pi->baud(57600); pi->format(8); pi->printf("Hello World\n\r"); pi->printf("Hello World\n"); pc->printf("Hello World\n"); while(1) { wait(1); pi->printf("Iteration %d\n", x); pc->printf("Iteration %d\n", x); x++; } }