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

Examples: Update ADC() #966

Open helgibbons opened 3 days ago

helgibbons commented 3 days ago

Should help with #965

helgibbons commented 3 days ago

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

Gadgetoid commented 2 days ago

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.