Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Chemical_Sensor_DMA by
Diff: MotorControl.h
- 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