sampleProgram

Dependencies:   QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo

Fork of 17robo_fuzi by kusano kiyoshige

Revision:
49:b041c815c063
Parent:
33:64fd1bd83bac
diff -r 96b5f5ebdfb0 -r b041c815c063 encorder.h
--- a/encorder.h	Wed Sep 13 00:19:44 2017 +0000
+++ b/encorder.h	Wed Sep 13 01:25:07 2017 +0000
@@ -27,11 +27,20 @@
     float duty() {
         return result;
     }
+    
+    float duty_enableWidth(float duty_min, float duty_max){
+        if(now > duty_min && now < duty_max){   //nowは差
+            return 0.0;
+        }else{
+            return result;
+        }
+    }
 
 private :
     float kp, ki, kd,
           old, now,
-          p, i, d, result;
+          p, i, d, result,
+          duty_min, duty_max;
 };
 /*
 class Speed_pid