offer some APIs to control the movement of motor. Suitable with Seeed motor shield
Dependents: Seeed_Motor_Shield_HelloWorld Seeed_Motor_Shield
Homepage
API Introduction¶
Import library
Public Member Functions |
|
MotorDriver (PinName int1, PinName int2, PinName int3, PinName int4, PinName speedA, PinName speedB) | |
Create Motor Driver instance.
|
|
void | init () |
set motor to initialized state
|
|
void | configure (uint8_t position, uint8_t motorID) |
config position of motor
|
|
void | setSpeed (uint8_t speed, uint8_t motorID) |
set speed of motor
|
|
void | setDirection (uint8_t direction, uint8_t motorID) |
set direction of motor,
|
|
void | rotate (uint8_t direction, uint8_t motor_position) |
rotate motor
|
|
void | rotateWithID (uint8_t direction, uint8_t motorID) |
rotate motorA or motorB
|
|
void | goForward () |
make motor go forward
|
|
void | goBackward () |
make motor go backward
|
|
void | goLeft () |
make motor go left
|
|
void | goRight () |
make motor go right
|
|
void | stop () |
make motor stop
|
|
void | stop (uint8_t motorID) |
make motorA or motorB stop
|
|
Data Fields |
|
MotorStruct | motorA |
motor A
|
|
MotorStruct | motorB |
motor B
|