diff options
| author | Curly <[email protected]> | 2025-02-23 07:33:58 -0800 |
|---|---|---|
| committer | Curly <[email protected]> | 2025-02-23 07:33:58 -0800 |
| commit | 3932835998802fc3abf7cce4f736e072858ebfd1 (patch) | |
| tree | 5dd714b99bc74a03556c58809237c88691c293bb /examples/rp235x/src/bin/rosc.rs | |
| parent | c3c67db93e627a4fafe5e1a1123e5cbb4abafe47 (diff) | |
rename `rp23` (?) folder to `rp235x`; fix `ci.sh` to use `rp235x` folder
Diffstat (limited to 'examples/rp235x/src/bin/rosc.rs')
| -rw-r--r-- | examples/rp235x/src/bin/rosc.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/rp235x/src/bin/rosc.rs b/examples/rp235x/src/bin/rosc.rs new file mode 100644 index 000000000..942b72319 --- /dev/null +++ b/examples/rp235x/src/bin/rosc.rs | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | //! This example test the RP Pico on board LED. | ||
| 2 | //! | ||
| 3 | //! It does not work with the RP Pico W board. See wifi_blinky.rs. | ||
| 4 | |||
| 5 | #![no_std] | ||
| 6 | #![no_main] | ||
| 7 | |||
| 8 | use defmt::*; | ||
| 9 | use embassy_executor::Spawner; | ||
| 10 | use embassy_rp::{clocks, gpio}; | ||
| 11 | use embassy_time::Timer; | ||
| 12 | use gpio::{Level, Output}; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | ||
| 14 | |||
| 15 | #[embassy_executor::main] | ||
| 16 | async fn main(_spawner: Spawner) { | ||
| 17 | let mut config = embassy_rp::config::Config::default(); | ||
| 18 | config.clocks = clocks::ClockConfig::rosc(); | ||
| 19 | let p = embassy_rp::init(config); | ||
| 20 | let mut led = Output::new(p.PIN_25, Level::Low); | ||
| 21 | |||
| 22 | loop { | ||
| 23 | info!("led on!"); | ||
| 24 | led.set_high(); | ||
| 25 | Timer::after_secs(1).await; | ||
| 26 | |||
| 27 | info!("led off!"); | ||
| 28 | led.set_low(); | ||
| 29 | Timer::after_secs(1).await; | ||
| 30 | } | ||
| 31 | } | ||
