Not enought RAM... how can I execute code in another module? #11243
nastiliano
started this conversation in
General
Replies: 1 comment 7 replies
-
What hardware are you using? As a general comment, threading is quite demanding on a microcontroller. Where possible it is much better to use uasyncio. See also tutorial. It is much more lightweight and also more highly developed. |
Beta Was this translation helpful? Give feedback.
7 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.
-
Hello everyone,
Sorry for this essential question, but I can't find exactly what I want.
I have this kind of code inside my "main.py":
import _thread
import anotherClass #(anotherClass.py)
...
def thread_1():
while True:
print("thread_1")
time.sleep(1)
def thread_2():
anotherClass.myClass() #in myClass there's infinite llop obviously
_thread.start_new_thread(thread_1 , ())
_thread.start_new_thread(thread_2 , ())
But, I have no idea how to execute this (boot.py, main.py and anotherClass.py) correctly.
It seems like the code freezes in thread_2
Somebody can help me?
Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions