esp-idf-hal icon indicating copy to clipboard operation
esp-idf-hal copied to clipboard

Examples iterating PinDriver

Open ishigoemon opened this issue 2 years ago • 0 comments

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.

ishigoemon avatar Oct 10 '22 00:10 ishigoemon