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

"run in background" code behaviour changes after adding neopixel-library #55

Open
kryt opened this issue Oct 27, 2020 · 0 comments
Open

Comments

@kryt
Copy link

kryt commented Oct 27, 2020

Neopixel-library seems to malfunction and cause issues with the internal mechanics of the microbit, if pause or forever-loop is not used.

Without neopixel-library:
When writing a code inside "run in background", and having everything inside a while(true), the code is reacting to button-presses and keeps track of time by using millis. For example, pressing a button that turns on a LED in e.g. pin1 for few seconds works fine.

However, after adding the neopixel-library and changing the code to use neopixels instead of LEDS breaks the functionality with reading pins and buttons. This extends to the radio as well, which ceases to work.

Curiously, inside "run in background" while(true), neopixels do work with millis alone. It is so far only when buttons/pins are used, or the radio is used, that the behaviour breaks.

Finally, if one adds pause(0) or moves the code to forever-loop, the code works and there are no issues (other than a very slow code due to the microbit itself). This, however, slows down the code to the point of being useless for reactive interactions.

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