Files
stm32_rust/hal_test/src/bin/main.rs
2025-10-20 22:37:21 +02:00

25 lines
644 B
Rust

#![no_std]
#![no_main]
use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_time::{Duration, Timer};
use embassy_stm32::init;
use embassy_stm32::Config;
use panic_halt as _;
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = init(Config::default());
// The user LED on NUCLEO-U575ZI-Q is typically on port B, pin 0 (verify silkscreen)
let mut led = Output::new(p.PB0, Level::Low, Speed::Low);
loop {
led.set_high();
Timer::after(Duration::from_millis(500)).await;
led.set_low();
Timer::after(Duration::from_millis(500)).await;
}
}