aboutsummaryrefslogtreecommitdiff
path: root/crates/rp-pico-2040/src/main.rs
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2026-09-05 14:48:35 -0400
committerIan McIntyre <me@mciantyre.dev>2026-09-05 14:49:56 -0400
commit8d9737324e9103d64d6e645d0d829b4b37d0793c (patch)
treea8ae354ab42c2a11a79d163c4df96123d1ad8592 /crates/rp-pico-2040/src/main.rs
parentbfa4501cd703149f4720a4ef6cdbe74ef6c3e361 (diff)
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.
Diffstat (limited to 'crates/rp-pico-2040/src/main.rs')
-rw-r--r--crates/rp-pico-2040/src/main.rs7
1 files changed, 4 insertions, 3 deletions
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);
}
}