RMD-X Motor Library - Last Update V0.5 - On going...... Current available Function - read velocity - read all data - send velocity - send position
Diff: RMD.cpp
- Revision:
- 1:5c31dcbaa375
- Parent:
- 0:433e4ec5de88
- Child:
- 2:d1f33fc9383b
--- a/RMD.cpp Wed Nov 04 09:20:53 2020 +0000 +++ b/RMD.cpp Wed Nov 04 09:36:31 2020 +0000 @@ -12,10 +12,8 @@ void RMD::status_velocity(){ if (read(msg)){ - int v_high = msg.data[5]; - int v_low = msg.data[4]; - v_high = v_high << 8 ; - int fv = (v_high + v_low)/6; + + int fv = ((uint16_t)msg.data[5] << 8 + (uint16_t)msg.data[4])/(uint16_t)6; printf(" Speed : %d\n", fv); printf(" Speed high byte: %x\n", msg.data[5]);