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.
main.cpp
00001 #include "mbed.h" 00002 #define BAUD 115200 00003 #define TX_PIN p9 00004 #define RX_PIN p10 00005 00006 #include "MODSERIAL.h" 00007 00008 DigitalOut led1(LED1); 00009 DigitalOut led2(LED2); 00010 DigitalOut led3(LED3); 00011 DigitalOut led4(LED4); 00012 00013 MODSERIAL pc(USBTX, USBRX); 00014 00015 MODSERIAL uart(TX_PIN, RX_PIN); 00016 00017 00018 int main() 00019 { 00020 pc.baud(BAUD); 00021 uart.baud(BAUD); 00022 //pc.printf("Start\n\r"); 00023 00024 // Transparent uart<->usb - working ! 00025 while(1) 00026 { 00027 if( pc.readable()) 00028 {led1=1; led4=0; uart.putc(pc.getc());} 00029 if( uart.readable()) 00030 {led4=1; led1=0; pc.putc(uart.getc());} 00031 } 00032 }
Generated on Mon Jul 25 2022 22:27:22 by
1.7.2