Add led toggle

This commit is contained in:
Sofia 2026-05-12 19:25:55 +03:00
parent 7644dfedcd
commit a80997fa63

View File

@ -9,6 +9,7 @@
use esp_hal::{
clock::CpuClock,
gpio::{Output, OutputConfig},
main,
time::{Duration, Instant},
};
@ -54,8 +55,15 @@ fn main() -> ! {
esp_alloc::heap_allocator!(#[esp_hal::ram(reclaimed)] size: 98768);
let mut led = Output::new(
peripherals.GPIO21,
esp_hal::gpio::Level::High,
OutputConfig::default(),
);
loop {
log::info!("Hello world!");
led.toggle();
let delay_start = Instant::now();
while delay_start.elapsed() < Duration::from_millis(500) {}
}