Motor
Fork of Motor by
motor.h
- Committer:
- Reiko
- Date:
- 2013-09-14
- Revision:
- 3:94db629c0a83
- Parent:
- 2:3faf5dcde08f
- Child:
- 4:2b77f4656e92
- Child:
- 5:99fa6dffea40
File content as of revision 3:94db629c0a83:
#ifndef MOTOR_H #define MOTOR_H #include "mbed.h" #include "PCA9555.h" #include "qed.h" class Motor { public: Motor(PinName PWMpin, PCA9555 *ioExt, unsigned int dir1Pin, unsigned int dir2Pin, PinName encA, PinName encB); void setPWM(int newPWM); void setSpeed(int newSpeed); int getSpeed(); void pid(); private: PwmOut pwm; PCA9555 *extIO; unsigned int dir1; unsigned int dir2; QED qed; int currentSpeed; int getDecoderCount(); void resetPID(); //void pid(); int setPoint; int pMulti; int iDiv; int dMulti; int error; int prevError; int P; int I; int D; int minPwm; int pidMulti; int iMax; }; #endif