DCS_TEAM / Mbed 2 deprecated Chemical_Sensor_DMA

Dependencies:   mbed

Dependents:   DCS_FINAL_CODE

Fork of Chemical_Sensor_DMA by Jared Baxter

MotorControl.h

Committer:
baxterja
Date:
2015-10-29
Revision:
2:3771b3195c7b

File content as of revision 2:3771b3195c7b:

#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