pimoroni-pico icon indicating copy to clipboard operation
pimoroni-pico copied to clipboard

Examples: Update ADC()

Open helgibbons opened this issue 1 year ago • 2 comments
trafficstars

Should help with #965

helgibbons avatar Jul 02 '24 12:07 helgibbons

I've not done anything with our Analog class in modules_py/pimoroni.py here, which might also need looking at?

helgibbons avatar Jul 02 '24 12:07 helgibbons

Thank you!

I guess in Analog it should be something like:

self.pin = ADC(pin) if isinstance(pin, Pin) else ADC(Pin(pin))

Looks like it's never actually called with a Pin instance, but it should probably handle that just in case.

Gadgetoid avatar Jul 03 '24 15:07 Gadgetoid

I think this has been rendered redundant by https://github.com/micropython/micropython/commit/2b8de7436bbdb54da99bf6bdb79359876fd3bc1d

Edit: Or rather, will be, as you correctly point out in #959 - when MicroPython 1.24.x is released 🤔

Gadgetoid avatar Oct 25 '24 15:10 Gadgetoid