How to blink a led on the new esp_hal crate?
Posted: Sun Sep 22, 2024 2:13 pm
I bought an esp32-h2 with an RGB led that says RGB@IO8 so I did
but it does not turn on.
How to make it work? Could it be that since it's RGB, I have to control it differently?
I couldn't find any examples on the new crate, just the old ones that are deprecated
Code: Select all
#[esp_hal_embassy::main]
async fn main(_spawner: Spawner) -> ! {
let mut peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
//...
let clocks = ClockControl::max(system.clock_control).freeze();
let mut io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
io.pins.gpio8.set_high();
loop {
//...
}
}
How to make it work? Could it be that since it's RGB, I have to control it differently?
I couldn't find any examples on the new crate, just the old ones that are deprecated