Teck H / Mbed 2 deprecated Nucleo_serial_passthrough

Dependencies:   mbed

Committer:
Teck
Date:
Sat Oct 24 21:41:25 2015 +0000
Revision:
0:da5e19098ee6
serial passthrough

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Teck 0:da5e19098ee6 1 #include "mbed.h"
Teck 0:da5e19098ee6 2
Teck 0:da5e19098ee6 3 //------------------------------------
Teck 0:da5e19098ee6 4 // Hyperterminal configuration
Teck 0:da5e19098ee6 5 // 9600 bauds, 8-bit data, no parity
Teck 0:da5e19098ee6 6 //------------------------------------
Teck 0:da5e19098ee6 7
Teck 0:da5e19098ee6 8 Serial pc(USBTX, USBRX); // tx, rx
Teck 0:da5e19098ee6 9 Serial device(PA_9, PA_10); // tx, rx
Teck 0:da5e19098ee6 10 //Serial device(PA_2, PA_3); // tx, rx
Teck 0:da5e19098ee6 11
Teck 0:da5e19098ee6 12 int main() {
Teck 0:da5e19098ee6 13 while(1) {
Teck 0:da5e19098ee6 14 if(pc.readable()) {
Teck 0:da5e19098ee6 15 device.putc(pc.getc());
Teck 0:da5e19098ee6 16 }
Teck 0:da5e19098ee6 17 if(device.readable()) {
Teck 0:da5e19098ee6 18 pc.putc(device.getc() + 5);
Teck 0:da5e19098ee6 19 }
Teck 0:da5e19098ee6 20 }
Teck 0:da5e19098ee6 21 }