Nonblocing getchar() or using printf() and serial.read() together

got it, I have to use:

static BufferedSerial console(STDIO_UART_TX, STDIO_UART_RX, 115200);
FileHandle *mbed::mbed_override_console(int) {
      return &console;
 }

then printf works and I can use console.readable() and console.read().

1 Like