Skip to content

Robot stops even though motor.hold() is not in the code. #1756

Answered by laurensvalk
kubotafamily asked this question in Q&A
Discussion options

You must be logged in to vote

At a glance, it looks like you have several while loops without any awaitable statements in them.

Any loop that may take some time to complete (such as waiting on some condition to occur) needs at least one awaitable statement in it, which gives other parallel tasks a chance to run.

For example, you could add:

await wait(1)

But since you aren't using multitasking yet, this is not the issue here.

Are you intentionally resetting the motor angle on every move while it is still running? This causes the motor to stop as it needs the position sensors to know how fast it is going.

Instead of resetting and then running to a given distance, you could instead measure the starting angle, and then le…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kubotafamily
Comment options

Answer selected by kubotafamily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants