Skip to content

Class rb::MotorChangeBuilder

ClassList > rb > MotorChangeBuilder

Helper class for building the motor change event.

  • #include <RBCXManager.h>

Public Functions

Type Name
MotorChangeBuilder ()
MotorChangeBuilder (const MotorChangeBuilder & o) = delete
MotorChangeBuilder (MotorChangeBuilder && o)
MotorChangeBuilder & brake (MotorId id, uint16_t brakingPower)
Start braking.
MotorChangeBuilder & drive (MotorId id, int32_t positionRelative, int16_t speedTicksPerSecond, Motor::callback_t callback=nullptr)
MotorChangeBuilder & driveToValue (MotorId id, int32_t positionAbsolute, int16_t speedTicksPerSecond, Motor::callback_t callback=nullptr)
MotorChangeBuilder & power (MotorId id, int16_t value)
Set single motor power.
MotorChangeBuilder & pwmMaxPercent (MotorId id, int8_t percent)
Limit motor index's power to percent.
void set ()
Finish the changes and submit the events.
MotorChangeBuilder & speed (MotorId id, int16_t ticksPerSecond)
Set single motor power.
~MotorChangeBuilder ()

Public Functions Documentation

function MotorChangeBuilder [1/3]

rb::MotorChangeBuilder::MotorChangeBuilder () 

function MotorChangeBuilder [2/3]

rb::MotorChangeBuilder::MotorChangeBuilder (
    const MotorChangeBuilder & o
) = delete

function MotorChangeBuilder [3/3]

rb::MotorChangeBuilder::MotorChangeBuilder (
    MotorChangeBuilder && o
) 

function brake

Start braking.

MotorChangeBuilder & rb::MotorChangeBuilder::brake (
    MotorId id,
    uint16_t brakingPower
) 

Parameters:

  • id of the motor (e.g. rb:MotorId::M1)
  • brakingPower power of the braking, <0, 32767>

function drive

MotorChangeBuilder & rb::MotorChangeBuilder::drive (
    MotorId id,
    int32_t positionRelative,
    int16_t speedTicksPerSecond,
    Motor::callback_t callback=nullptr
) 

function driveToValue

MotorChangeBuilder & rb::MotorChangeBuilder::driveToValue (
    MotorId id,
    int32_t positionAbsolute,
    int16_t speedTicksPerSecond,
    Motor::callback_t callback=nullptr
) 

function power

Set single motor power.

MotorChangeBuilder & rb::MotorChangeBuilder::power (
    MotorId id,
    int16_t value
) 

Parameters:

  • id of the motor (e.g. rb:MotorId::M1)
  • power of the motor <-32768; 32767>

function pwmMaxPercent

Limit motor index's power to percent.

MotorChangeBuilder & rb::MotorChangeBuilder::pwmMaxPercent (
    MotorId id,
    int8_t percent
) 

Parameters:

  • id of the motor (e.g. rb:MotorId::M1)
  • percent of the maximal power of the motor <0 - 100>

function set

void rb::MotorChangeBuilder::set () 

function speed

Set single motor power.

MotorChangeBuilder & rb::MotorChangeBuilder::speed (
    MotorId id,
    int16_t ticksPerSecond
) 

Parameters:

  • id of the motor (e.g. rb:MotorId::M1)
  • speed of the motor in encoder ticks <-32768; 32767>

function ~MotorChangeBuilder

rb::MotorChangeBuilder::~MotorChangeBuilder () 

The documentation for this class was generated from the following file demo-projets/esp/RBCXManager.h