Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SerialPassthrough by
main.cpp
00001 #include "mbed.h" 00002 00003 RawSerial pc(USBTX, USBRX); 00004 RawSerial dev(p28,p27); 00005 DigitalOut led1(LED1); 00006 DigitalOut led4(LED4); 00007 00008 void dev_recv() 00009 { 00010 led1 = !led1; 00011 while(dev.readable()) { 00012 pc.putc(dev.getc()); 00013 } 00014 } 00015 00016 void pc_recv() 00017 { 00018 led4 = !led4; 00019 while(pc.readable()) { 00020 dev.putc(pc.getc()); 00021 } 00022 } 00023 00024 int main() 00025 { 00026 pc.baud(9600); 00027 dev.baud(9600); 00028 00029 pc.attach(&pc_recv, Serial::RxIrq); 00030 dev.attach(&dev_recv, Serial::RxIrq); 00031 00032 while(1) { 00033 sleep(); 00034 } 00035 }
Generated on Thu Jul 14 2022 01:34:40 by
1.7.2

Adafruit Bluefruit LE UART Friend
Adafruit Huzzah