ichinoseki_Bteam_2019 / Motor

Dependents:   ArmNode

Revision:
3:00a812f5ac69
Parent:
2:55726bc51f31
Child:
4:ec8d27a44a4f
diff -r 55726bc51f31 -r 00a812f5ac69 Motor.cpp
--- a/Motor.cpp	Fri Aug 30 03:06:27 2019 +0000
+++ b/Motor.cpp	Sun Sep 15 17:40:14 2019 +0000
@@ -3,7 +3,7 @@
 
 Motor::Motor(PinName _pwm, PinName _dire, int freq) : pwm(_pwm), dire(_dire)
 {
-    abs_max_output = 1.0;
+    abs_max_output = 0.95;
     pwm.period(1.0 / freq);   
     pwm.write(0);
     dire = 0;
@@ -21,12 +21,12 @@
                 pwm = 0;
                 dire = 0;
             }
-            else if (output > abs_max_output * 0.05)
+            else if (output > 0.01)
             {
                 pwm = output * abs_max_output;
                 dire = 0;
             }
-            else if (output < -abs_max_output * 0.05)
+            else if (output < -0.01)
             {
                 pwm = -output * abs_max_output;
                 dire = 1;