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
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