HerkuleXLib  1.1
Arduino library to drive HerkuleX DRS-0101 and DRS-0201
/home/benoit/sketchbook/libraries/HerkuleXLib/HkxGroupContRotation.h
Go to the documentation of this file.
1 #ifndef _HKXGROUPCONTROTATION_H
2 #define _HKXGROUPCONTROTATION_H
3 
13 #include "HkxContRotation.h"
14 
21 private:
25  const uint8_t _length;
32  const String _className;
33 
34 
40  void errorPrint(const String& message){if(_print._errorMessages){_print.errorPrint(_className + message);}};
41 
47  void warningPrint(const String& message){if(_print._errorMessages){_print.warningPrint(_className + message);}};
48 
54  void infoPrint(const String& message){if(_print._errorMessages){_print.infoPrint(_className + message);}};
57 public:
67  HkxGroupContRotation(uint8_t length, HkxContRotation* arrayServos[], HkxPrint& print);
68 
76  HkxContRotation& getServo(uint8_t number){if(number < _length){return *_servos[number];}};
77 
83  uint8_t getNbServos(){return this->_length;};
84 
106  uint8_t setAllTorqueLEDControl(HkxMaybe<hkxTorqueControl> newTorqueControl, HkxMaybe<hkxLEDControl> newLEDControl);
107 
127  uint8_t moveAllRotation(int16_t pwm[], HkxMaybe<uint16_t> playTime, HkxMaybe<hkxLEDControl> LEDControl[]);
128 
133  void rebootAll(){
134  for(int i=0 ; i < this->_length ; i++){
135  this->_servos[i]->reboot();
136  }
137  };
138 };
139 
140 #endif // _HKXGROUPCONTROTATION_H
141 
uint8_t setAllTorqueLEDControl(HkxMaybe< hkxTorqueControl > newTorqueControl, HkxMaybe< hkxLEDControl > newLEDControl)
Set torque actuation and LED colour.
Definition: HkxGroupContRotation.cpp:51
Servo continuous rotation of the Arduino library for HerkuleX servo (DRS-0101 and DRS-0201 models) ...
void warningPrint(const String &message) const
Print warning.
Definition: HkxCommunication.h:394
Class to drive one servo in continuous rotation mode.
Definition: HkxContRotation.h:22
void errorPrint(const String &message) const
Print error.
Definition: HkxCommunication.h:381
Class to manage optional parameters.
Definition: HkxCommunication.h:202
void warningPrint(const String &message)
Print warning.
Definition: HkxGroupContRotation.h:47
uint8_t getNbServos()
Get number of servos.
Definition: HkxGroupContRotation.h:83
Class to manage the communication.
Definition: HkxCommunication.h:634
uint8_t moveAllRotation(int16_t pwm[], HkxMaybe< uint16_t > playTime, HkxMaybe< hkxLEDControl > LEDControl[])
Move servos in continuous rotation.
Definition: HkxGroupContRotation.cpp:87
void errorPrint(const String &message)
Print error.
Definition: HkxGroupContRotation.h:40
void infoPrint(const String &message)
Print info.
Definition: HkxGroupContRotation.h:54
HkxPrint & _print
Definition: HkxGroupContRotation.h:29
void rebootAll()
Reboot.
Definition: HkxGroupContRotation.h:133
HkxCommunication & _herkXCom
Definition: HkxGroupContRotation.h:27
Class to manage the print of the messages.
Definition: HkxCommunication.h:278
HkxContRotation & getServo(uint8_t number)
Get the nth servo.
Definition: HkxGroupContRotation.h:76
void infoPrint(const String &message) const
Print info.
Definition: HkxCommunication.h:407
uint8_t reboot()
Reboot servo.
Definition: HkxContRotation.cpp:259
Class to drive a group of servos in continuous rotation mode.
Definition: HkxGroupContRotation.h:20
const uint8_t _length
Definition: HkxGroupContRotation.h:25
const boolean _errorMessages
Definition: HkxCommunication.h:407
const String _className
Definition: HkxGroupContRotation.h:32
HkxContRotation ** _servos
Definition: HkxGroupContRotation.h:23
HkxGroupContRotation(uint8_t length, HkxContRotation *arrayServos[], HkxPrint &print)
Constructor.
Definition: HkxGroupContRotation.cpp:13