offer some APIs to control the movement of motor. Suitable with Seeed motor shield
Fork of MotorDriver by
Diff: MotorDriver.cpp
- Revision:
- 1:9c93f514f369
- Parent:
- 0:6bd25809e2e0
--- 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) {