#include <RBControl_encoder.hpp>
|
| ~Encoder () |
|
void | driveToValue (int32_t positionAbsolute, uint8_t power, std::function< void(Encoder &)> callback=nullptr) |
| Drive motor to set position (according absolute value). More...
|
|
void | drive (int32_t positionRelative, uint8_t power, std::function< void(Encoder &)> callback=nullptr) |
| Drive motor to set position (according relative value). More...
|
|
int32_t | value () |
| Get number of edges from encoder. More...
|
|
float | speed () |
| Get number of edges per one second. More...
|
|
◆ ~Encoder()
rb::Encoder::~Encoder |
( |
| ) |
|
◆ drive()
void rb::Encoder::drive |
( |
int32_t |
positionRelative, |
|
|
uint8_t |
power, |
|
|
std::function< void(Encoder &)> |
callback = nullptr |
|
) |
| |
Drive motor to set position (according relative value).
- Parameters
-
positionRelative | relative position on which the motor drive
e.g. if the actual motor position (value() ) is 1000 and the positionRelative is 100 then the motor will go to position 1100 |
power | maximal power of the motor when go to set position, allowed values: <0 - 100> |
callback | is a function which will be call after the motor arrive to set position [optional] |
◆ driveToValue()
void rb::Encoder::driveToValue |
( |
int32_t |
positionAbsolute, |
|
|
uint8_t |
power, |
|
|
std::function< void(Encoder &)> |
callback = nullptr |
|
) |
| |
Drive motor to set position (according absolute value).
- Parameters
-
positionAbsolute | absolute position on which the motor drive
e.g. if the actual motor position (value() ) is 1000 and the positionAbsolute is 100 then the motor will go backward to position 100 |
power | maximal power of the motor when go to set position, allowed values: <0 - 100> |
callback | is a function which will be called after the motor arrives to set position [optional] |
◆ speed()
float rb::Encoder::speed |
( |
| ) |
|
Get number of edges per one second.
- Returns
- The number of counted edges after one second.
◆ value()
int32_t rb::Encoder::value |
( |
| ) |
|
Get number of edges from encoder.
- Returns
- The number of counted edges from the first initialize of the encoder Manager::initEncoder
◆ Manager
◆ Motor
The documentation for this class was generated from the following files: