Class for Encoder Motor Driver.
More...
#include <src/MeEncoderMotor.h>
Class for Encoder Motor Driver.
Driver for Me Encoder Motor module.
Driver for Encoder Motor module.
- Copyright (C), 2012-2016, MakeBlock
◆ MeEncoderMotor() [1/3]
| MeEncoderMotor::MeEncoderMotor |
( |
uint8_t |
addr, |
|
|
uint8_t |
slot |
|
) |
| |
Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device.
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
| [in] | slot | - SLOT1 or SLOT2 |
◆ MeEncoderMotor() [2/3]
| MeEncoderMotor::MeEncoderMotor |
( |
uint8_t |
slot | ) |
|
Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device.
- Parameters
-
◆ MeEncoderMotor() [3/3]
| MeEncoderMotor::MeEncoderMotor |
( |
| ) |
|
Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you should initialized slot and slaveAddress here for the Encoder Motor device.
- Parameters
-
◆ begin()
| void MeEncoderMotor::begin |
( |
| ) |
|
- Function
- begin
- Description
- Initialize Encoder Motor.
- Parameters
-
- Output
- None
- Return
- None
- Others
- None
◆ getCurrentPosition()
| float MeEncoderMotor::getCurrentPosition |
( |
| ) |
|
- Function
- getCurrentPosition
- Description
- The current position of Motor.
- Parameters
-
- Output
- None
- Return
- None
- Others
- None
◆ getCurrentSpeed()
| float MeEncoderMotor::getCurrentSpeed |
( |
| ) |
|
- Function
- getCurrentSpeed
- Description
- The current speed of Motor's movement.
- Parameters
-
- Output
- None
- Return
- None
- Others
- None
◆ move()
| boolean MeEncoderMotor::move |
( |
float |
angle, |
|
|
float |
speed |
|
) |
| |
- Function
- move
- Description
- Motor move.
- Parameters
-
| [in] | angle | - The angle move of Motor. |
| [in] | speed | - The speed move of Motor. |
- Output
- None
- Return
- Return the result of Motor's movement.
- Others
- None
◆ moveTo()
| boolean MeEncoderMotor::moveTo |
( |
float |
angle, |
|
|
float |
speed |
|
) |
| |
- Function
- moveTo
- Description
- Motor move to the aim.
- Parameters
-
| [in] | angle | - The angle move of Motor. |
| [in] | speed | - The speed move of Motor. |
- Output
- None
- Return
- Return the result of Motor's movement to the aim.
- Others
- None
◆ reset()
| boolean MeEncoderMotor::reset |
( |
| ) |
|
- Function
- reset
- Description
- Reset the available data for Encoder Motor.
- Parameters
-
- Output
- None
- Returns
- None
- Others
- None
◆ runSpeed()
| boolean MeEncoderMotor::runSpeed |
( |
float |
speed | ) |
|
- Function
- runSpeed
- Description
- The speed of Motor's movement.
- Parameters
-
| [in] | speed | - The speed move of Motor. |
- Output
- None
- Return
- Return 0.
- Others
- None
◆ runSpeedAndTime()
| boolean MeEncoderMotor::runSpeedAndTime |
( |
float |
speed, |
|
|
float |
time |
|
) |
| |
- Function
- runSpeedAndTime
- Description
- The speed and time of Motor's movement.
- Parameters
-
| [in] | speed | - The speed move of Motor. |
| [in] | time | - The time move of Motor. |
- Output
- None
- Return
- Return the result of Motor's movement.
- Others
- None
◆ runTurns()
| boolean MeEncoderMotor::runTurns |
( |
float |
turns, |
|
|
float |
speed |
|
) |
| |
- Function
- runTurns
- Description
- Motor move turns.
- Parameters
-
| [in] | turns | - The turns move of Motor. |
| [in] | speed | - The speed move of Motor. |
- Output
- None
- Return
- Return the result of Motor's movement.
- Others
- None
The documentation for this class was generated from the following files: