[Solved] hMotorPimpl.cpp compilation into cloud.husarion.com

Hi,
I want to test to use my CORE2 with only 2 motors but the drivers into parallel mode to have more current abbility. There is the DRIVER_MODE_PARALLEL parameter into hMotorPimpl.cpp that seems to do the job.
So I’ve added this file and hMotorPimpl.h to my project but I’m not able to compile it into the Husarion Cloud.
There is this error during building:

In file included from hMotorPimpl.cpp:7:0:
hMotorPimpl.h:17:18: fatal error: port.h: No such file or directory
#include <port.h>

I tried to add the port.h file also but the issue steel the same.

Can you explain to me how to proceed to modify DRIVER_MODE_PARALLEL instead of DRIVER_MODE_SINGLE ?

Thanks

Hello Baptiste,

You do not need to include any files, they already are in IDE.
To switch between single and parallel mode, you can use functions:

Regards,
Łukasz

Hi Lukasz,
thanks it will be easy to use.
I also need to modify the duty cycle of the PWM (50% max for now).
I want to be able to configure it to 100% for max power.

It seems that there isn’t any configuration function availabled for that.
How can I do that ?

Regards,
Baptiste

You can set the duty cycle with setPower() function.
To set 100% power, use setPower(1000), or setPower(-1000) for reverse direction.

Regards,
Łukasz

Okay, so it’s the PID that is restraining the max duty cycle to 50% for the standard version of the CORE2 framework ?

Thanks very much, it will be very easy.
Baptiste