multitask() does not work. #1755
Answered
by
laurensvalk
kubotafamily
asked this question in
Q&A
-
I tried using multitask() with pybricks, but it does not execute at the same time. async def main():
# Program up to this point
while await left_color.reflection() >= 10:
tank.drive(-100, 58)
tank.hold()
await multitask(arm.command(arm.FAST_DOWN), main2())
async def main2():
await linetrace.shift_trace(0.4, 1, 0, 80, 1.5)
# Program from here The last multitask() of main(). |
Beta Was this translation helpful? Give feedback.
Answered by
laurensvalk
Aug 12, 2024
Replies: 1 comment 4 replies
-
Can you share the rest of the code? I think we'd need to see what the arm command does to see what's going on. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have a look at the other thread just now about having at least one awaitable statement in your loops.
If in doubt, add the following to any loop inside async def functions:
await wait(1)
Let me know how that goes :)