2018 HongoMechaTech A

Dependencies:   mbed

Revision:
0:e83b840a5f86
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/StraightMD.cpp	Tue Sep 18 03:11:01 2018 +0000
@@ -0,0 +1,30 @@
+#include"mbed.h"
+#include"StraightMD.h"
+StraightMD::StraightMD(PinName pwm,PinName dere):Pwm(pwm),Dere(dere)
+{
+    Pwm.period(0.0001);
+}
+
+
+void StraightMD::drive(double duty)
+{
+    if(duty > 0)
+    {
+        Dere = 0;
+        Pwm = abs(duty);
+    }
+    else
+    {
+        Dere = 1;
+        Pwm = abs(duty);
+    }
+}
+
+void StraightMD::brake(double duty){
+}
+
+
+
+void StraightMD::free()
+{
+}
\ No newline at end of file