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:
parent
20ed0b16ae
commit
449ed4b093
1 changed files with 3 additions and 3 deletions
|
@ -496,15 +496,15 @@ namespace create {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create::setMainMotor(const float& main) {
|
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) {
|
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) {
|
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() {
|
bool Create::updateLEDs() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue