76 void setTarget(uint8_t channelNumber, uint16_t target);
92 void setSpeed(uint8_t channelNumber, uint16_t speed);
246 uint8_t deviceNumber,
249 void writeByte(uint8_t dataByte);
251 void writeCommand(uint8_t commandByte);
252 void write7BitData(uint8_t data);
253 void write14BitData(uint16_t data);
257 static const uint8_t CRC7Polynomial = 0x91;
258 static const uint8_t baudRateIndication = 0xAA;
260 static const uint8_t miniSscCommand = 0xFF;
261 static const uint8_t setTargetCommand = 0x84;
262 static const uint8_t setSpeedCommand = 0x87;
263 static const uint8_t setAccelerationCommand = 0x89;
264 static const uint8_t getPositionCommand = 0x90;
265 static const uint8_t getMovingStateCommand = 0x93;
266 static const uint8_t getErrorsCommand = 0xA1;
267 static const uint8_t goHomeCommand = 0xA2;
268 static const uint8_t stopScriptCommand = 0xA4;
269 static const uint8_t restartScriptAtSubroutineCommand = 0xA7;
270 static const uint8_t restartScriptAtSubroutineWithParameterCommand = 0xA8;
271 static const uint8_t getScriptStatusCommand = 0xAE;
273 uint8_t _deviceNumber;
304 bool CRCEnabled =
false);
334 bool CRCEnabled =
false);
352 void setPWM(uint16_t onTime, uint16_t period);
375 uint8_t firstChannel,
376 uint16_t *targetList);
379 static const uint8_t setPwmCommand = 0x8A;
380 static const uint8_t setMultipleTargetsCommand = 0x9F;
uint16_t getErrors()
Gets the error register.
uint8_t getScriptStatus()
Gets if the script is running or stopped.
void setMultiTarget(uint8_t numberOfTargets, uint8_t firstChannel, uint16_t *targetList)
Sets multiple targets starting with the channel specified by firstChannel to a list of values listed ...
void stopScript()
Stops the script.
void goHome()
Sends the servos and outputs to home position.
MiniMaestro(Stream &stream, uint8_t resetPin=noResetPin, uint8_t deviceNumber=deviceNumberDefault, bool CRCEnabled=false)
Create a MiniMaestro object.
static const uint8_t deviceNumberDefault
The default device number, used to construct a MicroMaestro or MiniMaestro object that will use the c...
void reset()
Resets the Maestro by toggling the resetPin, if a resetPin was given.
static const uint8_t noResetPin
The default reset pin is no reset pin, used to construct a MicroMaestro or MiniMaestro object that wi...
void restartScript(uint8_t subroutineNumber)
Starts loaded script at specified subroutineNumber location.
MicroMaestro(Stream &stream, uint8_t resetPin=noResetPin, uint8_t deviceNumber=deviceNumberDefault, bool CRCEnabled=false)
Create a MicroMaestro object.
void setAcceleration(uint8_t channelNumber, uint16_t acceleration)
Sets the acceleration limit of channelNumber.
uint8_t getMovingState()
Gets the moving state for all configured servo channels.
void restartScriptWithParameter(uint8_t subroutineNumber, uint16_t parameter)
Starts loaded script at specified subroutineNumber location after loading parameter on to the stack...
void setSpeed(uint8_t channelNumber, uint16_t speed)
Sets the speed limit of channelNumber.
uint16_t getPosition(uint8_t channelNumber)
Gets the position of channelNumber.
Main Maestro class that handles common functions between the Micro Maestro and Mini Maestro...
void setTarget(uint8_t channelNumber, uint16_t target)
Sets the target of the servo on channelNumber.
void setTargetMiniSSC(uint8_t channelNumber, uint8_t target)
Sets the target of the servo on channelNumber using the Mini SSC protocol.
void setPWM(uint16_t onTime, uint16_t period)
Sets the PWM specified by onTime and period in units of 1/48 microseconds.