Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I am new for mbed and get a question about the following sample for serial #include "mbed.h" Serial pc(USBTX, USBRX); Serial uart(p28, p27); 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; } } } I think that the correct result is that a charactor inputed from terminal on PC will be send to uart, then send back to pc terminal, pc_activity and uart_activity will be on or off alternately. Is my understanding correct? But in my test, the charactor isn't sent back to pc's terminal and the uart_activity is always on. Anything wrong, pls suggest.