offer some APIs to control the movement of motor. Suitable with Seeed motor shield
Fork of MotorDriver by
Revision 1:9c93f514f369, committed 2014-02-12
- Comitter:
- lawliet
- Date:
- Wed Feb 12 03:07:34 2014 +0000
- Parent:
- 0:6bd25809e2e0
- Commit message:
- update documents
Changed in this revision
MotorDriver.cpp | Show annotated file Show diff for this revision Revisions of this file |
MotorDriver.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 6bd25809e2e0 -r 9c93f514f369 MotorDriver.cpp --- a/MotorDriver.cpp Wed Feb 12 02:54:52 2014 +0000 +++ b/MotorDriver.cpp Wed Feb 12 03:07:34 2014 +0000 @@ -50,12 +50,7 @@ if(motorID == MOTORA)motorA.direction= direction; else if(motorID == MOTORB)motorB.direction = direction; } -/**********************************************************************/ -/*Function: Get the motor rotate */ -/*Parameter:-uint8_t direction,Clockwise or anticlockwise; */ -/* -uint8_t motor_position,MOTOR_POSITION_LEFT or */ -/* MOTOR_POSITION_RIGHT; */ -/*Return: void */ + void MotorDriver::rotate(uint8_t direction, uint8_t motor_position) { if(motor_position == motorA.position) { @@ -65,11 +60,7 @@ rotateWithID(direction,MOTORB); } } -/**********************************************************************/ -/*Function: Get the motor rotate */ -/*Parameter:-uint8_t direction,Clockwise or anticlockwise; */ -/* -uint8_t motor_position,MOTORA or MOTORB */ -/*Return: void */ + void MotorDriver::rotateWithID(uint8_t direction, uint8_t motorID) { if(motorID == MOTORA) {
diff -r 6bd25809e2e0 -r 9c93f514f369 MotorDriver.h --- a/MotorDriver.h Wed Feb 12 02:54:52 2014 +0000 +++ b/MotorDriver.h Wed Feb 12 03:07:34 2014 +0000 @@ -139,28 +139,11 @@ private: - /** pin 1 of motor movement control - */ DigitalOut _int1; - - /** pin 2 of motor movement control - */ DigitalOut _int2; - - /** pin 3 of motor movement control - */ DigitalOut _int3; - - /** pin 4 of motor movement control - */ DigitalOut _int4; - - /** pin to control the speed of motorA - */ SoftwarePWM _speedA; - - /** pin to control the speed of motorB - */ SoftwarePWM _speedB; }; #endif