Browse Source

servo ui tested ba simulator the addres is wrong just for test

test
nasicurious 3 years ago
parent
commit
8d78ada7f8
  1. 1
      Servo/include/ModbusConfig.h
  2. 4
      Servo/src/ServoController.cpp

1
Servo/include/ModbusConfig.h

@ -11,7 +11,6 @@ struct ModbusConfig {
int dataBits = QSerialPort::Data8;
int stopBits = QSerialPort::OneStop;
int responseTime = 1000;
int numberOfRetries = 3;
};
#endif //SETTINGSERIALPARAMETERS_H

4
Servo/src/ServoController.cpp

@ -121,7 +121,7 @@ double ServoController::getStopAngle()
auto speedVector1 = _modbusWrapper.getHoldingRegister(SRV_STOP_ANGLE_INT_PART_REG, 1);
auto speedVector2 = _modbusWrapper.getHoldingRegister(SRV_STOP_ANGLE_FRAC_PART_REG, 1);
return ((speedVector1[0] + speedVector2[0]) / SRV_ANGLE_FACTOR);
return (speedVector1[0] + speedVector2[0] / SRV_ANGLE_FACTOR);
}
/*************************************************************************************************/
@ -130,7 +130,7 @@ double ServoController::getStartAngle()
auto speedVector1 = _modbusWrapper.getHoldingRegister(SRV_START_ANGLE_INT_PART_REG, 1);
auto speedVector2 = _modbusWrapper.getHoldingRegister(SRV_START_ANGLE_FRAC_PART_REG, 1);
return ((speedVector1[0] + speedVector2[0]) / SRV_ANGLE_FACTOR);
return (speedVector1[0] + speedVector2[0] / SRV_ANGLE_FACTOR);
}
/*************************************************************************************************/

Loading…
Cancel
Save