Driver for Me Encoder New module.
More...
#include <src/MeEncoderNew.h>
|
| | MeEncoderNew (uint8_t addr, uint8_t slot) |
| |
| | MeEncoderNew (uint8_t slot) |
| |
| | MeEncoderNew (void) |
| |
| void | begin (void) |
| |
| void | setAddr (uint8_t i2cAddr, uint8_t slot) |
| |
| void | reset (void) |
| |
| void | move (long angle, float speed=220, float lock_state=1) |
| |
| void | moveTo (long angle, float speed=220, float lock_state=1) |
| |
| void | runTurns (long turns, float speed=220, float lock_state=1) |
| |
| void | runSpeed (float speed, float lock_state=1) |
| |
| float | getCurrentSpeed (void) |
| |
| void | setCurrentPosition (long pulse_counter) |
| |
| long | getCurrentPosition (void) |
| |
| void | setSpeedPID (float p, float i, float d) |
| |
| void | setPosPID (float p, float i, float d) |
| |
| void | getSpeedPID (float *p, float *i, float *d) |
| |
| void | getPosPID (float *p, float *i, float *d) |
| |
| float | getRatio (void) |
| |
| void | setRatio (float r) |
| |
| int | getPulse (void) |
| |
| void | setPulse (int p) |
| |
| void | setDevid (uint8_t devid) |
| |
| void | setMode (uint8_t mode) |
| |
| void | setPWM (int pwm) |
| |
| void | runSpeedAndTime (float speed, float time, float lock_state=1) |
| |
| boolean | isTarPosReached (void) |
| |
| void | getFirmwareVersion (char *buffer) |
| |
Driver for Me Encoder New module.
Class: MeEncoderNew
- Description
- Declaration of Class MeEncoderNew
- Copyright (C), 2012-2016, MakeBlock
◆ MeEncoderNew() [1/3]
| MeEncoderNew::MeEncoderNew |
( |
uint8_t |
addr, |
|
|
uint8_t |
slot |
|
) |
| |
Alternate Constructor which can call your own function to map the Encoder Motor New to arduino port, you can set any slot for the Encoder Motor New device.
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to PORT_10 |
| [in] | slot | - SLOT1 or SLOT2 |
◆ MeEncoderNew() [2/3]
| MeEncoderNew::MeEncoderNew |
( |
uint8_t |
slot | ) |
|
Alternate Constructor which can call your own function to map the Encoder Motor New to arduino port, you can set any slot for the Encoder Motor New device.
- Parameters
-
◆ MeEncoderNew() [3/3]
| MeEncoderNew::MeEncoderNew |
( |
void |
| ) |
|
Alternate Constructor which can call your own function to map the Encoder Motor New to arduino port, you should initialized slot and slaveAddress here for the Encoder Motor New device.
- Parameters
-
◆ begin()
| void MeEncoderNew::begin |
( |
void |
| ) |
|
- Function
- begin
- Description
- Initialize Encoder Motor New.
- Parameters
-
- Output
- None
- Return
- None
- Others
- None
◆ getCurrentPosition()
| long MeEncoderNew::getCurrentPosition |
( |
void |
| ) |
|
- Function
- getCurrentPosition
- Description
- The current position of Motor.
- Parameters
-
- Output
- None
- Return
- Motor encoder pulse count value.
- Others
- None
◆ getCurrentSpeed()
| float MeEncoderNew::getCurrentSpeed |
( |
void |
| ) |
|
- Function
- getCurrentSpeed
- Description
- The current speed of Motor's movement.
- Parameters
-
- Output
- None
- Return
- The speed of encoder motor(The unit is rpm)
- Others
- None
◆ getFirmwareVersion()
| void MeEncoderNew::getFirmwareVersion |
( |
char * |
buffer | ) |
|
- Function
- getFirmwareVersion
- Description
- Get Firmware Version, Only support EncodeDriver-V2.1.0 module firmware
- Parameters
-
- Output
- buffer: for storage version, length greater than 8
- Returns
- None
- Others
◆ getPosPID()
| void MeEncoderNew::getPosPID |
( |
float * |
p, |
|
|
float * |
i, |
|
|
float * |
d |
|
) |
| |
- Function
- getPosPID
- Description
- Get PID from Motor.
- Parameters
-
| [in] | p | - P means Proportion. |
| [in] | i | - I means Integration. |
| [in] | d | - D means Differentiation. |
- Output
- None
- Return
- None
- Others
- None
◆ getPulse()
| int MeEncoderNew::getPulse |
( |
void |
| ) |
|
- Function
- getPulse
- Description
- Get the pulse of Motor.
- Parameters
-
- Output
- None
- Return
- Return the pulse of Motor.
- Others
- None
◆ getRatio()
| float MeEncoderNew::getRatio |
( |
void |
| ) |
|
- Function
- getRatio
- Description
- Get the ratio of Motor.
- Parameters
-
- Output
- None
- Return
- Return the ratio of Motor.
- Others
- None
◆ getSpeedPID()
| void MeEncoderNew::getSpeedPID |
( |
float * |
p, |
|
|
float * |
i, |
|
|
float * |
d |
|
) |
| |
- Function
- getSpeedPID
- Description
- Get Speed PID from Motor.
- Parameters
-
| [in] | p | - P means Proportion. |
| [in] | i | - I means Integration. |
| [in] | d | - D means Differentiation. |
- Output
- None
- Return
- None
- Others
- None
- Function
- getSpeedPID
- Description
- Get PID from Motor.
- Parameters
-
| [in] | p | - P means Proportion. |
| [in] | i | - I means Integration. |
| [in] | d | - D means Differentiation. |
- Output
- None
- Return
- None
- Others
- None
◆ isTarPosReached()
| boolean MeEncoderNew::isTarPosReached |
( |
void |
| ) |
|
- Function
- isTarPosReached
- Description
- Check whether the target position has been reached
- Parameters
-
- Output
- None
- Return
- true - The target position reaches false - Does not reach the target position
- Others
- None
◆ move()
| void MeEncoderNew::move |
( |
long |
angle, |
|
|
float |
speed = 220, |
|
|
float |
lock_state = 1 |
|
) |
| |
- Function
- move
- Description
- Motor move.
- Parameters
-
| [in] | angle | - The angle move of Motor New. |
| [in] | speed | - The speed move of Motor New. |
| [in] | lock_state | - The lock state of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ moveTo()
| void MeEncoderNew::moveTo |
( |
long |
angle, |
|
|
float |
speed = 220, |
|
|
float |
lock_state = 1 |
|
) |
| |
- Function
- moveTo
- Description
- Motor New move to the aim.
- Parameters
-
| [in] | angle | - The angle move of Motor New. |
| [in] | speed | - The speed move of Motor New. |
| [in] | lock_state | - The lock state of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ reset()
| void MeEncoderNew::reset |
( |
void |
| ) |
|
- Function
- reset
- Description
- Reset the parameter of Motor.
- Output
- None
- Return
- None
- Others
- None
◆ runSpeed()
| void MeEncoderNew::runSpeed |
( |
float |
speed, |
|
|
float |
lock_state = 1 |
|
) |
| |
- Function
- runSpeed
- Description
- The speed of Motor's movement.
- Parameters
-
| [in] | speed | - The speed move of Motor. |
- Output
- None
- Return
- None
- Others
- None
- Function
- runSpeed
- Description
- The speed of Motor's movement.
- Parameters
-
| [in] | speed | - The speed move of Motor. |
| [in] | lock_state | - The lock state of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ runSpeedAndTime()
| void MeEncoderNew::runSpeedAndTime |
( |
float |
speed, |
|
|
float |
time, |
|
|
float |
lock_state = 1 |
|
) |
| |
- 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. |
| [in] | lock_state | - The lock state of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ runTurns()
| void MeEncoderNew::runTurns |
( |
long |
turns, |
|
|
float |
speed = 220, |
|
|
float |
lock_state = 1 |
|
) |
| |
- Function
- runTurns
- Description
- Motor move turns.
- Parameters
-
| [in] | turns | - The turns move of Motor. |
| [in] | speed | - The speed move of Motor. |
| [in] | lock_state | - The lock state of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ setAddr()
| void MeEncoderNew::setAddr |
( |
uint8_t |
i2cAddr, |
|
|
uint8_t |
slot |
|
) |
| |
- Function
- setAddr
- Description
- Reset the i2c address of encoder motor .
- Parameters
-
| [in] | i2cAddr | - i2c address of encoder motor |
| [in] | slot | - slot number of encoder motor |
- Output
- None
- Return
- None
- Others
- None
◆ setCurrentPosition()
| void MeEncoderNew::setCurrentPosition |
( |
long |
pulse_counter | ) |
|
- Function
- setCurrentPosition
- Description
- Set current position of Motor.
- Parameters
-
| [in] | pulse_counter | - The count value of current encoder |
- Output
- None
- Return
- None
- Others
- None
◆ setDevid()
| void MeEncoderNew::setDevid |
( |
uint8_t |
devid | ) |
|
- Function
- setDevid
- Description
- Set the devid to Motor.
- Parameters
-
| [in] | devid | - the I2C adress |
- Output
- None
- Return
- None
- Others
- None
◆ setMode()
| void MeEncoderNew::setMode |
( |
uint8_t |
mode | ) |
|
- Function
- setMode
- Description
- Set the work mode to Motor.
- Parameters
-
| [in] | mode | - The work mode of Motor. |
- Output
- None
- Return
- None
- Others
- None
◆ setPosPID()
| void MeEncoderNew::setPosPID |
( |
float |
p, |
|
|
float |
i, |
|
|
float |
d |
|
) |
| |
- Function
- setPosPID
- Description
- Set pos PID for Motor.
- Parameters
-
| [in] | p | - P means Proportion. |
| [in] | i | - I means Integration. |
| [in] | d | - D means Differentiation. |
- Output
- None
- Return
- None
- Others
- None
◆ setPulse()
| void MeEncoderNew::setPulse |
( |
int |
pulse | ) |
|
- Function
- setPulse
- Description
- Set the pulse to Motor.
- Parameters
-
| [in] | pulse | - the line number of Motor |
- Output
- None
- Return
- None
- Others
- None
◆ setPWM()
| void MeEncoderNew::setPWM |
( |
int |
pwm | ) |
|
- Function
- setPWM
- Description
- Set the PWM to Motor.
- Parameters
-
| [in] | pwm | - Pulse-Width Modulation. |
- Output
- None
- Return
- None
- Others
- None
◆ setRatio()
| void MeEncoderNew::setRatio |
( |
float |
ratio | ) |
|
- Function
- setRatio
- Description
- Set the ratio to Motor.
- Parameters
-
| [in] | ratio | - the ratio of Motor |
- Output
- None
- Return
- None
- Others
- None
◆ setSpeedPID()
| void MeEncoderNew::setSpeedPID |
( |
float |
p, |
|
|
float |
i, |
|
|
float |
d |
|
) |
| |
- Function
- setSpeedPID
- Description
- Set speed PID for Motor.
- Parameters
-
| [in] | p | - P means Proportion. |
| [in] | i | - I means Integration. |
| [in] | d | - D means Differentiation. |
- Output
- None
- Return
- None
- Others
- None
The documentation for this class was generated from the following files: