Add led toggle
This commit is contained in:
parent
7644dfedcd
commit
a80997fa63
@ -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) {}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user