//! Blinks an LED
//!
//! This assumes that a LED is connected to GPIO4.
//! Depending on your target and the board you are using you should change the pin.
//! If your board doesn't have on-board LEDs don't forget to add an appropriate resistor.
//!

use esp_idf_hal::delay::FreeRtos;
use esp_idf_hal::gpio::*;
use esp_idf_hal::peripherals::Peripherals;

fn main() -> anyhow::Result<()> {
    esp_idf_sys::link_patches();

    let peripherals = Peripherals::take().unwrap();
    let mut led = PinDriver::output(peripherals.pins.gpio4)?;

    println!("Hello world!");
    loop {
        led.set_high()?;
        // we are sleeping here to make sure the watchdog isn't triggered
        FreeRtos::delay_ms(1000);

        led.set_low()?;
        FreeRtos::delay_ms(1000);
    }
}
$abcdeabcde151015202530354045505560fghijfghij
esp:0
esp:1
esp:2
esp:3
esp:4
esp:5
esp:6
esp:7
esp:8
esp:9
esp:10
esp:11
esp:12
esp:13
esp:15
esp:18
esp:19
esp:20
esp:21
esp:22
esp:23
esp:3V3
esp:RST
esp:5V
esp:GND.1
esp:NC0
esp:NC1
esp:GND.2
esp:GND.3
esp:RX
esp:TX
esp:GND.4
led1:A
led1:C
r1:1
r1:2
ring1:GND
ring1:VCC
ring1:DIN
ring1:DOUT