Fix motor setting (#62)

* Change 3 setAllMotor calls to use float parameter.

* Use static_cast for proper conversion to float.
This commit is contained in:
Daniel Smith 2021-04-19 02:29:20 -04:00 committed by GitHub
parent 20ed0b16ae
commit 449ed4b093
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -496,15 +496,15 @@ namespace create {
}
bool Create::setMainMotor(const float& main) {
return setAllMotors(main, sideMotorPower, vacuumMotorPower);
return setAllMotors(main, static_cast<float>(sideMotorPower) / 127.0, static_cast<float>(vacuumMotorPower) / 127.0);
}
bool Create::setSideMotor(const float& side) {
return setAllMotors(mainMotorPower, side, vacuumMotorPower);
return setAllMotors(static_cast<float>(mainMotorPower) / 127.0, side, static_cast<float>(vacuumMotorPower) / 127.0);
}
bool Create::setVacuumMotor(const float& vacuum) {
return setAllMotors(mainMotorPower, sideMotorPower, vacuum);
return setAllMotors(static_cast<float>(mainMotorPower) / 127.0, static_cast<float>(sideMotorPower) / 127.0, vacuum);
}
bool Create::updateLEDs() {