@@ -299,27 +299,31 @@ void SmartServoClass::setStallProtectionTime(uint8_t const id, uint8_t const ti
299299 mutex.unlock ();
300300}
301301
302- void SmartServoClass::setMinAngle (float const angle) {
302+ void SmartServoClass::setMinAngle (uint16_t const min_angle)
303+ {
303304 mutex.lock ();
304- writeWordCmd (BROADCAST, REG (SmartServoRegister::MIN_ANGLE_LIMIT_H), angleToPosition (angle) );
305+ writeWordCmd (BROADCAST, REG (SmartServoRegister::MIN_ANGLE_LIMIT_H), min_angle );
305306 mutex.unlock ();
306307}
307308
308- void SmartServoClass::setMinAngle (uint8_t const id, float const angle) {
309+ void SmartServoClass::setMinAngle (uint8_t const id, uint16_t const min_angle)
310+ {
309311 mutex.lock ();
310- writeWordCmd (id, REG (SmartServoRegister::MIN_ANGLE_LIMIT_H), angleToPosition (angle) );
312+ writeWordCmd (id, REG (SmartServoRegister::MIN_ANGLE_LIMIT_H), min_angle );
311313 mutex.unlock ();
312314}
313315
314- void SmartServoClass::setMaxAngle (float const angle) {
316+ void SmartServoClass::setMaxAngle (uint16_t const max_angle)
317+ {
315318 mutex.lock ();
316- writeWordCmd (BROADCAST, REG (SmartServoRegister::MAX_ANGLE_LIMIT_H), angleToPosition (angle) );
319+ writeWordCmd (BROADCAST, REG (SmartServoRegister::MAX_ANGLE_LIMIT_H), max_angle );
317320 mutex.unlock ();
318321}
319322
320- void SmartServoClass::setMaxAngle (uint8_t const id, float const angle) {
323+ void SmartServoClass::setMaxAngle (uint8_t const id, uint16_t const max_angle)
324+ {
321325 mutex.lock ();
322- writeWordCmd (id, REG (SmartServoRegister::MAX_ANGLE_LIMIT_H), angleToPosition (angle) );
326+ writeWordCmd (id, REG (SmartServoRegister::MAX_ANGLE_LIMIT_H), max_angle );
323327 mutex.unlock ();
324328}
325329
@@ -340,4 +344,4 @@ void SmartServoClass::getInfo(Stream & stream, uint8_t const id) {
340344 for (i = 0 ; i < sizeof (regs); i++) {
341345 stream.println (String (i, HEX) + " : " + String (regs[i], HEX));
342346 }
343- }
347+ }
0 commit comments