From a80997fa63ed0a1d2036a94444d42dc9b0e0c34f Mon Sep 17 00:00:00 2001 From: Sofia Date: Tue, 12 May 2026 19:25:55 +0300 Subject: [PATCH] Add led toggle --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 29efb04..4a2caea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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) {} }