Motors

Moderator: cpp4robots_admin

dave
Posts: 4
Joined: 17 Dec 2020 17:01
Contact:

Motors

Post by dave »

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.
cpp4robots_admin
Administrátor fóra
Posts: 21
Joined: 04 Nov 2020 14:34
Contact:

Re: Motors

Post by cpp4robots_admin »

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
dave
Posts: 4
Joined: 17 Dec 2020 17:01
Contact:

Re: Motors

Post by dave »

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
cpp4robots_admin
Administrátor fóra
Posts: 21
Joined: 04 Nov 2020 14:34
Contact:

Re: Motors

Post by cpp4robots_admin »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests