RCServo Class

class RCServoClass : public Acroname::BrainStem::EntityClass

The RCServoClass is the interface to servo entities on BrainStem modules. Servo entities are built upon the digital input/output pins and therefore can also be inputs or outputs. Please see the product datasheet on the configuration limitations.

Public Functions

RCServoClass(void)

Constructor.

virtual ~RCServoClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters
  • pModule: The module to which this entity belongs.
  • index: The index of the servo entity being initialized.

aErr setEnable(const uint8_t enable)

Enable the servo channel

Return
Returns common entity return values
Parameters
  • enable: The state to be set. 0 is disabled, 1 is enabled.

aErr getEnable(uint8_t *enable)

Get the enable status of the servo channel.

Return
Returns common entity return values
Parameters
  • enable: The current enable status of the servo entity. 0 is disabled, 1 is enabled.

aErr setPosition(const uint8_t position)

Set the position of the servo channel

Return
Returns common entity return values
Parameters
  • position: The position to be set. Default 64 = a 1ms pulse and 192 = a 2ms pulse.

aErr getPosition(uint8_t *position)

Get the position of the servo channel

Return
Returns common entity return values
Parameters
  • position: The current position of the servo channel. Default 64 = a 1ms pulse and 192 = a 2ms pulse.

aErr setReverse(const uint8_t reverse)

Set the output to be reversed on the servo channel

Return
Returns common entity return values
Parameters
  • reverse: Reverses the value set by “setPosition”. ie. if the position is set to 64 (1ms pulse) the output will now be 192 (2ms pulse); however, “getPostion” will return the set value of 64. 0 = not reversed, 1 = reversed.

aErr getReverse(uint8_t *reverse)

Get the reverse status of the servo channel

Return
Returns common entity return values
Parameters
  • reverse: The current reverse status of the servo entity. 0 = not reversed, 1 = reversed.