energy changed
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
//
|
||||
#include "energy/energy.h"
|
||||
#include <iostream>
|
||||
#include "log.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,7 +12,7 @@ using namespace std;
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// 此函数用于发送数据给主控板
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
void Energy::sendTarget(Serial& serial, float x, float y, char change, char shoot){
|
||||
void Energy::sendTarget(Serial& serial, float x, float y, float z){
|
||||
static short x_tmp, y_tmp, z_tmp;
|
||||
uint8_t buff[8];
|
||||
x_tmp = static_cast<short>(x * (32768 - 1) / 100);
|
||||
@@ -20,9 +22,10 @@ void Energy::sendTarget(Serial& serial, float x, float y, char change, char shoo
|
||||
buff[2] = static_cast<char>((x_tmp >> 0) & 0xFF);
|
||||
buff[3] = static_cast<char>((y_tmp >> 8) & 0xFF);
|
||||
buff[4] = static_cast<char>((y_tmp >> 0) & 0xFF);
|
||||
buff[5] = change;
|
||||
buff[6] = shoot;
|
||||
buff[5] = static_cast<char>((z_tmp >> 8) & 0xFF);
|
||||
buff[6] = static_cast<char>((z_tmp >> 0) & 0xFF);
|
||||
buff[7] = 'e';
|
||||
serial.WriteData(buff, sizeof(buff));
|
||||
send_cnt+=1;
|
||||
// LOGM(STR_CTR(WORD_LIGHT_PURPLE, "send"));
|
||||
}
|
||||
Reference in New Issue
Block a user