use std::{thread::sleep, time::Duration};
use esp_idf_hal::gpio::{Gpio2, Output, PinDriver};
use esp_idf_hal::peripherals::Peripherals;
fn main() {
// Inicializa os periféricos do ESP32
let peripherals = Peripherals::take().unwrap();
// Define o pino 2 como saída
let mut led = PinDriver::output(peripherals.pins.gpio2).unwrap();
loop {
led.set_high().unwrap(); // Liga o LED
sleep(Duration::from_secs(9));
led.set_low().unwrap(); // Desliga o LED
sleep(Duration::from_secs(1));
}
}