Hi! It's me again.
I have some code like this in my program but it's not always behaving as intended.
It works most of the times (repeats the loop while the motor is turning), but sometimes it skips it
and start executing the following code while the motor is still running.
It seems to happen most often when the motor is running at low speeds.
My hypothesis is that isMotorBusy() gives the wrong result if the motor isn't turning fast enough.
Code: Select all
SpeedMotor_RotationAngle(E_Port_D, speed, angle);
while (isMotorBusy(E_Port_D, E_MotorType_Medium))
{
[do some stuff...]
EV3_Sleep(50);
}
[more stuff...] // this should not be executed until the motor is done moving.
How do I know when a new version is released?
P.S. cpp4robots is great! I never had so much fun with EV3 before!
Hi! It's me again. :)
I have some code like this in my program but it's not always behaving as intended.
It works most of the times (repeats the loop while the motor is turning), but sometimes it skips it
and start executing the following code while the motor is still running.
It seems to happen most often when the motor is running at low speeds.
My hypothesis is that isMotorBusy() gives the wrong result if the motor isn't turning fast enough.
[code]
SpeedMotor_RotationAngle(E_Port_D, speed, angle);
while (isMotorBusy(E_Port_D, E_MotorType_Medium))
{
[do some stuff...]
EV3_Sleep(50);
}
[more stuff...] // this should not be executed until the motor is done moving.
[/code]
How do I know when a new version is released?
P.S. cpp4robots is great! I never had so much fun with EV3 before! :D