RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Public Member Functions | List of all members
rb::MotorChangeBuilder Class Reference

Helper class for building the motor change event. More...

#include <RBControl_manager.hpp>

Public Member Functions

 MotorChangeBuilder (Manager &manager)
 
 MotorChangeBuilder (const MotorChangeBuilder &o)=delete
 
 MotorChangeBuilder (MotorChangeBuilder &&o)
 
 ~MotorChangeBuilder ()
 
MotorChangeBuilderpower (MotorId id, int8_t value)
 Set single motor power. More...
 
MotorChangeBuilderpwmMaxPercent (MotorId id, int8_t percent)
 Limit motor index's power to percent. More...
 
MotorChangeBuilderstop (MotorId id)
 Stop motor. More...
 
void set (bool toFront=false)
 Finish the changes and submit the events. More...
 

Detailed Description

Helper class for building the motor change event.

Constructor & Destructor Documentation

◆ MotorChangeBuilder() [1/3]

rb::MotorChangeBuilder::MotorChangeBuilder ( Manager manager)

◆ MotorChangeBuilder() [2/3]

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

◆ MotorChangeBuilder() [3/3]

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

◆ ~MotorChangeBuilder()

rb::MotorChangeBuilder::~MotorChangeBuilder ( )

Member Function Documentation

◆ power()

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

Set single motor power.

Parameters
idof the motor (e.g. rb:MotorId::M1)
powerof the motor <-100 - 100>

◆ pwmMaxPercent()

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

Limit motor index's power to percent.

Parameters
idof the motor (e.g. rb:MotorId::M1)
percentof the maximal power of the motor <0 - 100>

◆ set()

void rb::MotorChangeBuilder::set ( bool  toFront = false)

Finish the changes and submit the events.

Parameters
toFrontadd this event to front of the event queue

◆ stop()

MotorChangeBuilder & rb::MotorChangeBuilder::stop ( MotorId  id)

Stop motor.

Parameters
idof the motor (e.g. rb:MotorId::M1)

The documentation for this class was generated from the following files: