embassy
embassy copied to clipboard
how a generic pin
currently testing embassy on stm32f401 (blackpill board)
I want to read the value of adc from a list:
for pin in pins.iter_mut() {
info!("{}", adc.read(pin));
}
or
for analog in pins.iter_mut() {
info!("{}", analog.read());
}
it was possible to generate list pins ?
thanks
You can do .degrade_adc() on a pin, which converts all pins to the same type, AnyAdcChannel.
See example: https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/adc_dma.rs#L55-L68
Thank this work ;-)
by only on master