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.
7 years, 2 months ago.
how to use the "printf" function and see its result, when using mbed complier
I am using mbed online compiler , and here is the source code :
- include "mbed.h" DigitalOut led_red(LED_RED); InterruptIn sw2(SW2); void sw2_release(void) { led_red = !led_red; printf("On-board button SW2 was released.\n"); } int main() { sw2.rise(&sw2_release); while (true) { } } Can I use printf function ? and how to get its printout result on K22F. through the primary serious port ? I am using the picocom and configured to /dev/ttyACM0 and 115200 braut in a linux environment , but didn't get any serial infomation printed out.
Question relating to:
1 Answer
7 years, 2 months ago.
It goes via the USB-SDA port, on the COM port that should be available on that one. The default baudrate is 9600 and not 115200.