Replies: 2 comments 5 replies
-
What version of MicroPython are you using? There have been numerous fixes to threading. FWIW, your exact code snippet works for me on the latest firmware from https://micropython.org/download/rp2-pico/ e.g. v1.19.1-543-gab317a0d6 (2022-10-11) .uf2 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm on a pico-w and I've just upgraded to rp2-pico-w-20221011-unstable-v1.19.1-543-gab317a0d6 And tried again.. this is the output I get
There is a difference between the boards inasmuch as the onboard LED is addressed differently.. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a simple bit of code to detect a button and when it's pressed light the onboard LED.
As I wanted to explore threading I used a separate thread for this. This is the code I used to try and prove the concept. Whilst I'm using a button it's wired into an ADC (I was previously using a photoresistor and didn't bother changing the code, but same deal)
Point is - when I run this you get the messages out showing it working. Until you press the button and it lights the LED. At that point the thread crashes. Comment the LED actions out and it works perfectly,
So why does accessing the LED kill the thread? Is this expected? Have I missed something in the documentation? Or is this a bug of some kind. _thread is marked as very experimental,
rp2-pico-w-20221011-unstable-v1.19.1-532-g8e912a501
Beta Was this translation helpful? Give feedback.
All reactions