|
RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
|
#include <RBControl_motor.hpp>
Public Member Functions | |
| void | power (int8_t value) |
| Set motor power. More... | |
| void | pwmMaxPercent (int8_t percent) |
| Limit the maximum PWM value. If you call pwmMaxPercent(70) and then power(100), the motors will spin at 70% of maximum speed. More... | |
| int8_t | pwmMaxPercent () const |
| Get current maximum PWM percent value. More... | |
| void | stop () |
| Stop motor. More... | |
| void | driveToValue (int32_t positionAbsolute, uint8_t power, std::function< void(Encoder &)> callback=nullptr) |
| Drive motor to set position (according absolute value). See Encoder::driveToValue. More... | |
| void | drive (int32_t positionRelative, uint8_t power, std::function< void(Encoder &)> callback=nullptr) |
| Drive motor to set position (according relative value). See Encoder::drive. More... | |
| Encoder * | encoder () |
| Get the Encoder instance for this motor. See Encoder. More... | |
| Encoder * | enc () |
| Get the Encoder instance for this motor. Same as encoder. More... | |
Friends | |
| class | Manager |
| class | MotorChangeBuilder |
| void rb::Motor::drive | ( | int32_t | positionRelative, |
| uint8_t | power, | ||
| std::function< void(Encoder &)> | callback = nullptr |
||
| ) |
Drive motor to set position (according relative value). See Encoder::drive.
| void rb::Motor::driveToValue | ( | int32_t | positionAbsolute, |
| uint8_t | power, | ||
| std::function< void(Encoder &)> | callback = nullptr |
||
| ) |
Drive motor to set position (according absolute value). See Encoder::driveToValue.
| void rb::Motor::power | ( | int8_t | value | ) |
Set motor power.
| power | of the motor <-100 - 100> |
|
inline |
Get current maximum PWM percent value.
| void rb::Motor::pwmMaxPercent | ( | int8_t | percent | ) |
Limit the maximum PWM value. If you call pwmMaxPercent(70) and then power(100), the motors will spin at 70% of maximum speed.
| pct | of the max value <0 - 100> |
| void rb::Motor::stop | ( | ) |
Stop motor.
|
friend |
|
friend |