変な加速

Dependencies:   T_motor

Revision:
1:d0b60b54e3bd
Parent:
0:29872002539b
diff -r 29872002539b -r d0b60b54e3bd P_motor.cpp
--- a/P_motor.cpp	Fri Oct 20 09:56:12 2017 +0000
+++ b/P_motor.cpp	Wed Oct 25 09:29:53 2017 +0000
@@ -26,7 +26,7 @@
 void P_motor::run()
 {
     motor = output_m;
-    pc.printf("%+3f\n\r", output_m);
+    //pc.printf("%+3f\n\r", output_m);
 }
 
 void P_motor::compute()
@@ -46,6 +46,7 @@
         {
             //output[1] = -target / 2;
             free();
+            //output_reset(target / -2.0f);
         }
         else
         {
@@ -64,6 +65,12 @@
     }
 }
 
+void P_motor::direct_controll(double target_)
+{
+    motor = target_;
+    output_reset();
+}
+
 void P_motor::free()
 {
     motor.free();