aboutsummaryrefslogtreecommitdiff
path: root/examples/mcxa/src/bin/button.rs
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-12-11 09:08:50 -0600
committerGitHub <[email protected]>2025-12-11 09:08:50 -0600
commit1aadce76847a7686bf66e3a6532e18e05042f78a (patch)
treeca42d80e784a6746065bd4e0c676db3ef0f10b93 /examples/mcxa/src/bin/button.rs
parent52a9b08f0ca13d23bfb039c884a9101997c10567 (diff)
parentf650afc33b2d6b39116f27c6545c5f2d9e3c7d06 (diff)
Merge branch 'main' into main
Diffstat (limited to 'examples/mcxa/src/bin/button.rs')
-rw-r--r--examples/mcxa/src/bin/button.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/mcxa/src/bin/button.rs b/examples/mcxa/src/bin/button.rs
new file mode 100644
index 000000000..943edbb15
--- /dev/null
+++ b/examples/mcxa/src/bin/button.rs
@@ -0,0 +1,23 @@
1#![no_std]
2#![no_main]
3
4use embassy_executor::Spawner;
5use embassy_time::Timer;
6use hal::gpio::{Input, Pull};
7use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _};
8
9#[embassy_executor::main]
10async fn main(_spawner: Spawner) {
11 let p = hal::init(hal::config::Config::default());
12
13 defmt::info!("Button example");
14
15 // This button is labeled "WAKEUP" on the FRDM-MCXA276
16 // The board already has a 10K pullup
17 let monitor = Input::new(p.P1_7, Pull::Disabled);
18
19 loop {
20 defmt::info!("Pin level is {:?}", monitor.get_level());
21 Timer::after_millis(1000).await;
22 }
23}