I'm struggling to get code running on the second core.
A couple of questions:
1) How do you stop the code running once it's started with start_new_thread? Is it enough to break out of the function? When I do this I can't seem to use start_new_thread a second time.
2) Am I right to assume that you cannot pass a single parameter to a function with start_new_thread? I get a tuple error when I try sending just one.
Is any additional functionality being considered for utilising the second Pico core (I'm using v1.14)?
start_new_thread
Re: start_new_thread
Call _thread.exit()How do you stop the code running once it's started with start_new_thread?
You can pass a single element tuple: (value, )Am I right to assume that you cannot pass a single parameter to a function with start_new_thread? I get a tuple error when I try sending just one.
Re: start_new_thread
Thanks for the single element tuple syntax. That was one combination I didn't try.
I'm not having much luck trying to stop code running on the second core. Do I call the _thread.exit() from the main core or from the background running function?
Are you able to give a short example (on a Pico).
I'm not having much luck trying to stop code running on the second core. Do I call the _thread.exit() from the main core or from the background running function?
Are you able to give a short example (on a Pico).
Re: start_new_thread
_thread.exit() will be called from within the newly started thread.