esp-idf-hal
esp-idf-hal copied to clipboard
Examples iterating PinDriver
With the conversion to PinDriver, examples such as #22 and others utilizing .degrade()/.downgrade() do not seem to be working.
Something like this works, but doesn't seem correct.
let a = peripherals.pins.gpio1.downgrade_output();
let b = peripherals.pins.gpio2.downgrade_output();
let mut pins = vec![a,b];
for pin in pins.iter_mut() {
let p = PinDriver::output(pin)?;
p.set_high()?;
}
Apologies if I've missed something obvious, quite new to rust.