Miya Miyagawa
/
NRP2020_main
Outher...Miura Souta
Diff: Motor/Motor.cpp
- Revision:
- 4:15547d07f8e5
- Parent:
- 2:32d2cd7d744b
--- a/Motor/Motor.cpp Fri Jan 24 11:26:29 2020 +0000 +++ b/Motor/Motor.cpp Sat Jan 25 00:40:35 2020 +0000 @@ -67,18 +67,18 @@ } float percentage_to_ratio(float percentage) { - return percentage / 100.0; + return percentage / 100.0f; } int Motor::SetStatus(float pwm) { - if(pwm > 0.0) return FOR; - else if(pwm < 0.0) return BACK; + if(pwm > 0.0f) return FOR; + else if(pwm < 0.0f) return BACK; else return BRAKE; } float Motor::SetPWM(float pwm) { - if(pwm > 0.0) return pwm; - else if(pwm < 0.0) return -pwm; + if(pwm > 0.0f) return pwm; + else if(pwm < 0.0f) return -pwm; else return 80; }