2018 HongoMechaTech A

Dependencies:   mbed

Revision:
0:e83b840a5f86
diff -r 000000000000 -r e83b840a5f86 lib/PID_Control.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/PID_Control.h	Tue Sep 18 03:11:01 2018 +0000
@@ -0,0 +1,24 @@
+#ifndef PID_CONTROL_H_
+#define PID_CONTROL_H_
+
+#include <mbed.h>
+
+class PID_Control
+{
+public:
+    PID_Control(double kp = 0, double ki = 0, double kd = 0);
+    
+    double PID(double present, double target, double interval);
+    void reset();
+    void set_PID(double kp, double ki, double kd);
+        
+private:
+    
+    double diff[2];
+    double integral;
+    double p, i, d;
+    double kp, ki, kd;
+    double control;
+};
+
+#endif
\ No newline at end of file