diff --git a/energy/src/energy/send/send.cpp b/energy/src/energy/send/send.cpp index aa5952e..8ecb479 100644 --- a/energy/src/energy/send/send.cpp +++ b/energy/src/energy/send/send.cpp @@ -14,7 +14,7 @@ using namespace std; // --------------------------------------------------------------------------------------------------------------------- void Energy::sendTarget(Serial& serial, float x, float y, float z){ static short x_tmp, y_tmp, z_tmp; - uint8_t buff[8]; + uint8_t buff[10]; x_tmp = static_cast(x * (32768 - 1) / 100); y_tmp = static_cast(y * (32768 - 1) / 100); z_tmp = static_cast(z * (32768 - 1) / 100); @@ -25,7 +25,9 @@ void Energy::sendTarget(Serial& serial, float x, float y, float z){ buff[4] = static_cast((y_tmp >> 0) & 0xFF); buff[5] = static_cast((z_tmp >> 8) & 0xFF); buff[6] = static_cast((z_tmp >> 0) & 0xFF); - buff[7] = 'e'; + buff[7] = 0; + buff[8] = 0; + buff[9] = 'e'; serial.WriteData(buff, sizeof(buff)); send_cnt+=1; // LOGM(STR_CTR(WORD_LIGHT_PURPLE, "send"));