This program test's the serial communication (RS232) for GR-PEACH board at 9600 baud rate. It echo’s the character back on screen for testing the transmit and receive modes.
main.cpp@0:56614af10008, 2016-09-27 (annotated)
- Committer:
- ec_rahul46
- Date:
- Tue Sep 27 05:22:57 2016 +0000
- Revision:
- 0:56614af10008
This is a program to test serial communication of GR-PEACH board at 9600 baud rate, 1 stop bit , no parity and flow control
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ec_rahul46 | 0:56614af10008 | 1 | //Echo back characters you type |
ec_rahul46 | 0:56614af10008 | 2 | |
ec_rahul46 | 0:56614af10008 | 3 | #include "mbed.h" |
ec_rahul46 | 0:56614af10008 | 4 | |
ec_rahul46 | 0:56614af10008 | 5 | Serial pc(USBTX, USBRX); |
ec_rahul46 | 0:56614af10008 | 6 | |
ec_rahul46 | 0:56614af10008 | 7 | int main() { |
ec_rahul46 | 0:56614af10008 | 8 | pc.printf("Echoes back to the screen anything you type\n"); |
ec_rahul46 | 0:56614af10008 | 9 | while(1) { |
ec_rahul46 | 0:56614af10008 | 10 | pc.putc(pc.getc()); |
ec_rahul46 | 0:56614af10008 | 11 | } |
ec_rahul46 | 0:56614af10008 | 12 | } |