22 lines
463 B
C
22 lines
463 B
C
// UART-to-USB CDC bridge for Pico
|
|
// UART0 RX on GPIO 1, 115200 baud → USB serial output
|
|
#include "pico/stdlib.h"
|
|
#include <stdio.h>
|
|
|
|
#define UART_ID uart0
|
|
#define UART_RX_PIN 1
|
|
#define BAUD 115200
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
uart_init(UART_ID, BAUD);
|
|
gpio_set_function(UART_RX_PIN, GPIO_FUNC_UART);
|
|
|
|
while (true) {
|
|
if (uart_is_readable(UART_ID)) {
|
|
char c = uart_getc(UART_ID);
|
|
putchar(c);
|
|
}
|
|
}
|
|
}
|