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