DCS_TEAM / Mbed 2 deprecated Chemical_Sensor_DMA

Dependencies:   mbed

Dependents:   DCS_FINAL_CODE

Fork of Chemical_Sensor_DMA by Jared Baxter

Revision:
2:3771b3195c7b
diff -r f0a5690db73f -r 3771b3195c7b MotorControl.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MotorControl.h	Thu Oct 29 17:15:20 2015 +0000
@@ -0,0 +1,26 @@
+#ifndef MOTOR_CONTROL_H
+#define MOTOR_CONTROL_H
+ 
+#include "mbed.h"
+#include "pause.cpp"
+ 
+class MotorControl {
+public:
+    MotorControl(PinName cw, PinName ccw, int period, int safetyPeriod);
+    
+    void off(); // make sure the motor is off
+    void clockwise(float);
+    void releaseMallet(); // release mallet using hard coded timing
+    void reset(); // reset mallet using feedback (NEEDS TO BE IMPLEMENTED)
+    
+    // what we threw together just for testing
+    void hardReset(int);         // reset mallet using hard coded timing
+    
+private:  
+    PwmOut _cw;    // clock wise rotation when _cw = 1
+    PwmOut _ccw;   // counter-clock wise rotation when _ccw = 1
+    int _period;       // the period of the motor switching cycle
+    int _safetyPeriod; // dead time between transition from cw to ccw (and visa versa)
+};
+ 
+#endif
\ No newline at end of file