felipe manrique
/
FRDM_serial_pc_board_pass_through
serial pc board pass through, use your board like a usb-serial 3.3V level converter,
Revision 0:bab6dd4a9c11, committed 2013-10-05
- Comitter:
- felipeM
- Date:
- Sat Oct 05 19:46:21 2013 +0000
- Commit message:
- FRDM seral pc board pass through based in :; https://mbed.org/handbook/SerialPC
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Oct 05 19:46:21 2013 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +//TX RX pins, see https://mbed.org/handbook/mbed-FRDM-KL25Z +Serial uart(PTC4, PTC3); +//to test is you can use a hard bridge (piece of cable) between PTC4 and PTC3 open a terminal and write something :) +//you can integrate this to improve some interesting aplicattions like this: +//http://www.instructables.com/id/Temperature-sensor--weatherstation/http://www.instructables.com/id/Temperature-sensor--weatherstation/ +DigitalOut pc_activity(LED1); +DigitalOut uart_activity(LED2); + +int main() { + while(1) { + if(pc.readable()) { + uart.putc(pc.getc()); + pc_activity = !pc_activity; + } + if(uart.readable()) { + pc.putc(uart.getc()); + uart_activity = !uart_activity; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Oct 05 19:46:21 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file