pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.23k stars 474 forks source link

ADC(pin) needs to be ADC(machine.Pin(pin)) in recent versions of MicroPython #965

Open helgibbons opened 3 days ago

helgibbons commented 3 days ago

When using high ADC pin numbers, you now need to init ADC(machine.Pin(29)) instead of ADC(29), for example.

As per: https://forums.pimoroni.com/t/pico-lipo-not-reading-battery-voltage/25060/

More info/discussion at https://github.com/micropython/micropython/issues/10947

Gadgetoid commented 6 hours ago

I think this might be fixed at the MicroPython level now: https://github.com/micropython/micropython/commit/2b8de7436bbdb54da99bf6bdb79359876fd3bc1d