reverse endianess for modbus read
This commit is contained in:
@@ -35,8 +35,8 @@ void do_kraftsensor(){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
kraftsensor_valid = 1;
|
kraftsensor_valid = 1;
|
||||||
int32_t tmp = (uint32_t)m_data[0]<<16;
|
int32_t tmp = (uint32_t)m_data[1]<<16;
|
||||||
tmp |= m_data[1];
|
tmp |= m_data[0];
|
||||||
|
|
||||||
/* conversion magic to milliNewton */
|
/* conversion magic to milliNewton */
|
||||||
kraftsensor_value = ((tmp + 539363)*9.81)/177.380;
|
kraftsensor_value = ((tmp + 539363)*9.81)/177.380;
|
||||||
|
|||||||
Reference in New Issue
Block a user