rainbow

Dependencies:   mbed FastPWM

Revision:
43:b084e5f5d0d5
Parent:
42:1cf66990ccab
Child:
45:35fa6884d0c6
diff -r 1cf66990ccab -r b084e5f5d0d5 CAN/function_CAN.cpp
--- a/CAN/function_CAN.cpp	Thu Dec 26 00:19:14 2019 +0000
+++ b/CAN/function_CAN.cpp	Tue Jan 07 08:39:22 2020 +0000
@@ -716,14 +716,14 @@
         ReadCMD(CMD);
     } else if(address==CID_RX_REF_POSITION) {
         //int32_t temp_pos = (int32_t) (msg.data[0] | msg.data[1] << 8 | msg.data[2] << 16 | msg.data[3] << 24);
-        int32_t temp_pos = (int32_t) (msg.data[0] | msg.data[1] << 8);
+        int16_t temp_pos = (int16_t) (msg.data[0] | msg.data[1] << 8);
         //int32_t temp_vel = (int32_t) (msg.data[4] | msg.data[5] << 8 | msg.data[6] << 16 | msg.data[7] << 24);
-        int32_t temp_vel = (int32_t) (msg.data[2] | msg.data[3] << 8);
+        int16_t temp_vel = (int16_t) (msg.data[2] | msg.data[3] << 8);
         
         int16_t temp_torq = (int16_t) (msg.data[4] | msg.data[5] << 8);
         pos.ref = (double)temp_pos * 4.0f;
         vel.ref = (double)temp_vel * 100.0f;
-        torq.ref = (double)temp_torq;
+        torq.ref = (double)temp_torq * 0.1f;
     } else if(address==CID_RX_REF_TORQUE) {
         int16_t temp_torq = (int16_t) (msg.data[0] | msg.data[1] << 8);
         torq.ref = (double)temp_torq;