Miya Miyagawa
/
NRP2020_main
Outher...Miura Souta
Revision 4:15547d07f8e5, committed 2020-01-25
- Comitter:
- Ryosei
- Date:
- Sat Jan 25 00:40:35 2020 +0000
- Parent:
- 3:8790e69f8c59
- Commit message:
- This is the program, used in NRP.
Changed in this revision
MCP/MCP.h | Show annotated file Show diff for this revision Revisions of this file |
Motor/Motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MCP/MCP.h Fri Jan 24 11:26:29 2020 +0000 +++ b/MCP/MCP.h Sat Jan 25 00:40:35 2020 +0000 @@ -17,7 +17,7 @@ #define GPA5 5 #define GPA6 6 #define GPA7 7 -#define GPB0 8 +#define GPB0 8 #define GPB1 9 #define GPB2 10 #define GPB3 11
--- 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; }