Reading ADC(29) Hangs Pico W?

Hi!

My first post so forgive me.

When I try to use the example code to check the battery level on a Pico W it works if I run the code manually. But if I load the code into a main.py and set it off running it hangs the Pico W. This seems to only happen AFTER I do “vsys = machine.ADC(29)”

Does anyone have any thoughts about this or experienced similar issues?

I’m running battery condition code on my Tufty, and a Pico Lipo without issues. Posting your whole block of code might help. What uf2 did you use?

Not sure if cross-posting is allowed here but what the heck. I posted this over on the Raspberry Pi forum and got some traction (I also have more of the code documented there as well). There is another user that can replicate the behavior I’m seeing but we also seem to have a documented workaround as well. So far no one can tell why trying to read ADC(29) causes Micropython/Wifi/Pico to hang/crash like it is. Maybe someone from Pimoroni or Raspberry Pi will respond with some thoughts.

https://forums.raspberrypi.com/viewtopic.php?t=339994