RCServo¶
- class brainstem.entity.RCServo(module, index)[source]¶
RCServoClass: 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.
- getEnable()[source]¶
Get the enable status of the servo channel. The current enable status of the servo entity. 0 is disabled, 1 is enabled.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getPosition()[source]¶
Get the position of the servo channel The current position of the servo channel. Default 64 = a 1ms pulse and 192 = a 2ms pulse.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getReverse()[source]¶
Get the reverse status of the servo channel The current reverse status of the servo entity. 0 = not reversed, 1 = reversed.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- setEnable(enable)[source]¶
Enable the servo channel
- Parameters:
enable (const unsigned char) – The state to be set. 0 is disabled, 1 is enabled.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setPosition(position)[source]¶
Set the position of the servo channel
- Parameters:
position (const unsigned char) – The position to be set. Default 64 = a 1ms pulse and 192 = a 2ms pulse.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setReverse(reverse)[source]¶
Set the output to be reversed on the servo channel
- Parameters:
reverse (const unsigned char) – 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.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte