Multitasking
#2034
Replies: 1 comment
-
from pybricks.tools import multitask, run_task, wait
async def task1():
while True:
# do stuff
...
await wait(0)
async def task2():
while True:
# do stuff
...
await wait(0)
async def main():
await multitask(task1(), task2())
run_task(main()) Key point: each loop needs an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using Prime hub how can I make 2 while loops run at the same time?
Beta Was this translation helpful? Give feedback.
All reactions