HerkuleXLib
1.1
Arduino library to drive HerkuleX DRS-0101 and DRS-0201
|
Class to drive a group of servos in continuous rotation mode. More...
#include <HkxGroupContRotation.h>
Public Member Functions | |
HkxGroupContRotation (uint8_t length, HkxContRotation *arrayServos[], HkxPrint &print) | |
Constructor. More... | |
HkxContRotation & | getServo (uint8_t number) |
Get the nth servo. More... | |
uint8_t | getNbServos () |
Get number of servos. More... | |
uint8_t | setAllTorqueLEDControl (HkxMaybe< hkxTorqueControl > newTorqueControl, HkxMaybe< hkxLEDControl > newLEDControl) |
Set torque actuation and LED colour. More... | |
uint8_t | moveAllRotation (int16_t pwm[], HkxMaybe< uint16_t > playTime, HkxMaybe< hkxLEDControl > LEDControl[]) |
Move servos in continuous rotation. More... | |
void | rebootAll () |
Reboot. More... | |
Private Attributes | |
HkxContRotation ** | _servos |
const uint8_t | _length |
HkxCommunication & | _herkXCom |
HkxPrint & | _print |
Class to drive a group of servos in continuous rotation mode.
This class allows to drive a group of servos in continuous rotation mode.
HkxGroupContRotation::HkxGroupContRotation | ( | uint8_t | length, |
HkxContRotation * | arrayServos[], | ||
HkxPrint & | |||
) |
Constructor.
The constructor of HkxGroupContRotation.
[in] | length | : Number of servos in the table _servos. |
[in] | arrayServos[] | : Array of pointers to the servos. |
[in] | : Communication to print messages. |
|
inline |
Get number of servos.
Get the number of servos manage by the instance.
|
inline |
Get the nth servo.
Get the nth servo.
[in] | number | : number of servo to get (from the table _servos). |
number
< _ref _length otherwise return void. uint8_t HkxGroupContRotation::moveAllRotation | ( | int16_t | pwm[], |
HkxMaybe< uint16_t > | playTime, | ||
HkxMaybe< hkxLEDControl > | LEDControl[] | ||
) |
Move servos in continuous rotation.
Perform a move of all the servos in continuous rotation mode.
[in] | pwm[] | : Array of torque power to apply. Its value shall be set in PWM within the range [-1023 ; 1023]. |
[in] | playTime | : Time of the action. Its value shall be set in milliseconds. This parameter is optional, either set a uint16_t (or unsigned int ) variable, or set HKX_NO_VALUE to ignore it. |
[in] | LEDControl[] | : Array of LED control to apply. This parameter is optional, either set a hkxLEDControl variable, the value (list below), or set HKX_NO_VALUE to ignore it.
|
|
inline |
Reboot.
Reboot all the servos.
uint8_t HkxGroupContRotation::setAllTorqueLEDControl | ( | HkxMaybe< hkxTorqueControl > | newTorqueControl, |
HkxMaybe< hkxLEDControl > | newLEDControl | ||
) |
Set torque actuation and LED colour.
Set the same torque actuation (hkxTorqueControl for more details) and the LED colour (hkxLEDControl for more details) to all the servos.
[in] | newTorqueControl | : Torque control to apply. This parameter is optional, either set a hkxTorqueControl variable, the value (list below), or set HKX_NO_VALUE to ignore it.
|
[in] | newLEDControl | : LED control to apply. This parameter is optional, either set a hkxLEDControl variable, the value (list below), or set HKX_NO_VALUE to ignore it.
|
|
private |
Communication with servos
|
private |
Number of servos in the table _servos
|
private |
Communication to print messages
|
private |
Array of pointers to HkxContRotation instances