Motors

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Motors

Re: Motors

by cpp4robots_admin » 27 Dec 2020 09:25

Hi Dave,

Thank you for your other notice.
We will add this issue with function isMotorBusy to our plan for the next release.
How do I know when a new version is released?
Visual studio should notify you that a new version of Cpp4Robots is available.

Cpp4Robots Support

Re: Motors

by dave » 23 Dec 2020 16:38

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! :D

Re: Motors

by cpp4robots_admin » 18 Dec 2020 08:05

Hi Dave,

We're glad you like the Cpp4Robots extension.

As for the PowerMotor_RotationAngle and SpeedMotor_RotationAngle functions, you're right.
Thank you for your helpful notice.
We will modify these functions in the next version of the Cpp4Robots extension.

Cpp4Robots Support

Motors

by dave » 17 Dec 2020 17:16

Hi!
First thing want to say is thank you for creating and maintaining cpp4robots! I'm so happy I can finally program EV3 in c++! :D

I don't know if I'm doing something wrong but it seems to me that the functions PowerMotor_RotationAngle() and SpeedMotor_RotationAngle() need
a positive or negative number for power or speed according to the direction of rotation.
I think it would be helpful if they just used the absolute value since the direction is already given by the angle parameter.

Top