From 8d9737324e9103d64d6e645d0d829b4b37d0793c Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sat, 5 Sep 2026 14:48:35 -0400 Subject: Add USB serial stdout for RP2040 Builds on the capabilities of the BSP. Unlike the other hardare-specific packages, I'm using alloc for conveying stdout messages. Check out the imxrt stdout package for a different approach. --- crates/rp-pico-2040/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/rp-pico-2040/src/main.rs') diff --git a/crates/rp-pico-2040/src/main.rs b/crates/rp-pico-2040/src/main.rs index b155870..389257a 100644 --- a/crates/rp-pico-2040/src/main.rs +++ b/crates/rp-pico-2040/src/main.rs @@ -3,9 +3,10 @@ use rust_threadx_rp_pico_2040 as _; use std::{thread, time::Duration}; fn main() { - // Nothing interesting yet. Nevertheless, the LED should - // be blinking on a background thread. + let mut count = 0_usize; loop { - thread::sleep(Duration::from_millis(100)); + println!("Hello world! The count is {count}\r"); + thread::sleep(Duration::from_millis(1_000)); + count = count.wrapping_add(1); } } -- cgit v1.2.3