增加vofa验证

This commit is contained in:
2026-03-24 09:08:41 +08:00
parent d4e3887a84
commit ab637b3431

View File

@@ -10,6 +10,7 @@
static bool sendTarget(Serial &serial, double yaw, uint16_t shoot_delay, bool fire) {
/*
uint8_t buff[7];
#ifdef WITH_COUNT_FPS
@@ -27,7 +28,7 @@ static bool sendTarget(Serial &serial, double yaw, uint16_t shoot_delay, bool fi
#define MINMAX(value, min, max) value = ((value) < (min)) ? (min) : ((value) > (max) ? (max) : (value))
short yaw_tmp = static_cast<short>(yaw * (32768 - 1) / 100);
buff[0] = 's';
buff[1] = static_cast<char>((yaw_tmp >> 8) & 0xFF);
buff[2] = static_cast<char>((yaw_tmp >> 0) & 0xFF);
@@ -36,6 +37,12 @@ static bool sendTarget(Serial &serial, double yaw, uint16_t shoot_delay, bool fi
buff[5] = fire ? 1 : 0; // 1为开火 0为闭嘴
buff[6] = 'e';
return serial.WriteData(buff, sizeof(buff));
*/
// Vofa串口验证 不用可以注释掉
char buff[128];
int len = sprintf(buff,"channels: %f, %f, %d\n", yaw, shoot_delay, fire);
return serial.WriteData(buff, len);
}
bool ArmorFinder::sendAntiTopTarget(double yaw, uint16_t shoot_delay, bool fire) {