Skip to content

micro:bit v2 micropython detecting if power is supplied from USB micro port #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
burksfamly opened this issue Nov 16, 2024 · 0 comments

Comments

@burksfamly
Copy link

burksfamly commented Nov 16, 2024

I have researched this topic.

To make sure I have not missed anything, is there any way I can directly or indirectly determine in real-time using micropython whether or not the micro:bit v2 is being powered by the USB micro connection (i.e., not battery).

  • it is my understanding that the USB internal interface is NOT exposed to micropython
  • if I can't read directly, is there possibly another register I could read that would indirectly indicate USB power only
    (in other words, the only way that this bit would be high is if the micro:bit was on USB power)
  • it would be nice if a could monitor the register fir state of the red LED on the back of the micro:bit (the RED LED
    is bright when it is on USB power, dim when on battery power and off when not powered).
  • I really, really do not want to do this, but I could tie a light sensor to an analog pin and code and monitor the
    red LED brightness on the back of the micro:bit (it is bright when on USB power and dim when on battery power)

Any thoughts?

Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant