//! Blinks an LED
//!
//! This assumes that a LED is connected to the pin assigned to `led`. (GPIO4)

#![no_std]
#![no_main]

use esp_backtrace as _;
use esp_hal::{
    delay::Delay,
    gpio::{Level, Output},
    prelude::*,
};
use log::info;

#[entry]
fn main() -> ! {
    let peripherals = esp_hal::init(esp_hal::Config::default());
    esp_println::logger::init_logger_from_env();

    let mut led = Output::new(peripherals.GPIO4, Level::High);
    let delay = Delay::new();

    info!("Hello world!");
    loop {
        info!("Toggling LED...");
        led.toggle();
        delay.delay(1500.millis());
    }
}