Skip to content
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

Micro:Bit freeze when analog read #79

Closed
ardaij opened this issue Jun 5, 2021 · 3 comments
Closed

Micro:Bit freeze when analog read #79

ardaij opened this issue Jun 5, 2021 · 3 comments

Comments

@ardaij
Copy link

ardaij commented Jun 5, 2021

Hi,

In our school, we programming micro:bits in MicroPython. For analog reading, the microbit freezes at irregular intervals.

The error can be reproduced with this code:

`from microbit import *

light = False

while True:
pin1.read_analog()
display.set_pixel(2, 2, 5 if light else 0)
light = not light
sleep(200)
`

We use microbit v2 microcontrollers: MicroPython v1.13 on 2021-03-16; micro:bit v2.0.0-beta.5 with nRF52833
We tested this with 7 of the same Micro:Bits.

Please help us.

I also asked this question in another forum because I don’t know where we can get help.

Thanks

@dpgeorge
Copy link
Collaborator

dpgeorge commented Jun 5, 2021

This is likely the same as #73, and it was fixed by commit 291e05c

Testing the above script with that commit, it doesn't freeze.

@ardaij
Copy link
Author

ardaij commented Jun 5, 2021

I just built the micropython from the github repository, and I copied the hex file onto the microbits.

MicroPython v1.15-64-g1e2f0d280 on 2021-06-05; micro:bit v2.0.0-beta.5 with nRF52833

I ran the program for several hours without error. This seems to have solved the problem. Maybe it would be good if others tested it as well.

Thanks

And thank you for the MicroPython...

@microbit-carlos
Copy link
Contributor

Glad you got it working and thanks for the report @ardaij!
I'll close this as resolved as the fix will be present in the next release.

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

3 participants