pimoroni / badger2040

Examples and firmware for Badger 2040 and Badger 2040 W
MIT License
165 stars 53 forks source link

Badger_OS v0.0.3 VBUS sensing seems blind #59

Closed Arthur-Philip-Dent closed 1 year ago

Arthur-Philip-Dent commented 1 year ago

@helgibbons animated me to report, that the badger_os v0.0.3 on Badger2040W(!) has an issue:

Code reads VBUS, but there will never appear a 'True', even if USB is plugged in:

from machine import ADC, I2C, Pin

# reading 'WL_GPIO2' on a picoW tells us whether or not USB power is connected (VBUS Sense)
vbus = Pin("WL_GPIO2", Pin.IN).value()
print(f"vbus: {vbus}")

Output Thonny (when USB is plugged in):

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
vbus: 0
>>> 

Since there is a newer version v0.0.4, with an even worse bug, this is just an idea, how the v0.0.4 got its reall bad bug, not recognizing the 'WL_GPIO2' pin anymore...

Arthur-Philip-Dent commented 1 year ago

Closed. I flashed the v0.0.3 again and it works like a charme. I think, I did a mistake. I can't reproduce the error. Current output in (verified) v0.0.3 is:

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
vbus: 1

Sorry for the buzz...!