Controlling brushless motor with I2c Pca9685 [RESOLVED]

Hey how are you!!!

Sure

Basically testing the motors sending different signals i found out that the max and min throttle of my motors are
//MOTORS
#define MIN_THROTTLE 217
** #define MAX_THROTTLE 410**

Then I create my pca
Adafruit_PWMServoDriver servos = Adafruit_PWMServoDriver(0x40);

Then I init the pca
void initPCA() {
** servos.begin(); **
** servos.setPWMFreq(50); //Frecuecia PWM de 60Hz o T=16,66ms**
}

Then I init the motors
void initMotors() {
** servos.setPWM(2,0,204);**
** servos.setPWM(11,0,204);**
** delay(1000);**
}

And finally I send the power
servos.setPWM(2,0,poweryneg);
servos.setPWM(11,0,powerypos);
First parameter is the pin in which the motor is attached and the last one is the power between 217 and 410 in my case

I hope it helps and let me know anything else you need

Cheers,
Marco

1 Like