Skip to main content

Raspberry Pi Pico - USB Serial Communication (C SDK)

·49 words
icysamon
Author
icysamon
Electronics & Creator

CMakeLists.txt
#

Add the following code.

# serial port
pico_enable_stdio_usb(project_name 1)

This will enable stdio_usb.

Initialization
#

First, include stdio.h.

#include "stdio.h"

Then, add the following code to the main function of your project.

stdio_init_all(); // Enable stdio_usb support

Output
#

Output data using the print function.

printf("hello world!\n");