From aa31a1fe67ee731cd2d912d8a9dd3b8063dc0c1d Mon Sep 17 00:00:00 2001 From: xu Date: Wed, 7 Jan 2026 19:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E5=9C=B0=E9=9D=A2=E9=9F=B3?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E7=A7=B0=E9=87=8D=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=B8=B8=E6=95=B0=E9=92=88=E5=AF=B9=E9=A3=9E?= =?UTF-8?q?=E6=9C=BA=E8=B0=83=E6=95=B4=EF=BC=8C=E7=94=B5=E5=8E=8B=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=89=93=E5=BC=80=EF=BC=8C=E8=A6=81=E4=B8=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=94=B5=E5=8E=8B=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/FoodDeliveryBase.cpp | 2 +- src/FoodDeliveryBase.h | 2 +- src/commser.cpp | 20 ++++++++++++-------- src/config.h | 2 +- src/main.cpp | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/FoodDeliveryBase.cpp b/src/FoodDeliveryBase.cpp index 99b33c5..8d97252 100644 --- a/src/FoodDeliveryBase.cpp +++ b/src/FoodDeliveryBase.cpp @@ -527,7 +527,7 @@ void FoodCube::mav_request_data() int len = mavlink_msg_to_send_buffer(buf, &msg); SWrite(buf, len, mavlinkSerial); } - // printf("send_mav\n"); + //ESP_LOGD(MOUDLENAME, "request_data_stream\n"); } /** diff --git a/src/FoodDeliveryBase.h b/src/FoodDeliveryBase.h index 0c00c6b..d542313 100644 --- a/src/FoodDeliveryBase.h +++ b/src/FoodDeliveryBase.h @@ -72,7 +72,7 @@ public: V9 = 9 }; unsigned long lastRunTime = 0; // playText()上次运行时间戳 - void playText(String str, VoiceVolume vol = V5); + void playText(String str, VoiceVolume vol = V1); void SetplayvolMax(); uint8_t chekVoiceMcu(); void stopVoice(); diff --git a/src/commser.cpp b/src/commser.cpp index df565d0..851f417 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -473,8 +473,10 @@ void mavlink_receiveCallback(uint8_t c) { // MAVLink解析是按照一个一个字符进行解析,我们接收到一个字符,就对其进行解析,直到解析完(根据返回标志判断)一帧数据为止。 // 通过msgid来判断 数据流的类别 char buf[50]; - - // printf("mav_id:%d\n",msg.msgid); + + //ESP_LOGD(MOUDLENAME, "mav_id:%d\n",msg.msgid); + + // printf("mav_id:%d\n",msg.msgid); switch (msg.msgid) { // case MAVLINK_MSG_ID_RC_CHANNELS: // #65 遥控通道数据 @@ -721,12 +723,14 @@ void mavlink_receiveCallback(uint8_t c) { mavlink_sys_status_t sys_status; // 解构的数据放到这个对象 mavlink_msg_sys_status_decode(&msg, &sys_status); // 解构msg数据 - // // 电压 - // sprintf(buf, "%.2f", (double)sys_status.voltage_battery / 1000); - // if (topicPubMsg[1] != buf) - // { // 有更新 则更新数据 - // topicPubMsg[1] = buf; - // } + //ESP_LOGD(MOUDLENAME, "SYS_STATUS:V:%.2f,C:%.2f,%d\n",(double)sys_status.voltage_battery / 1000, + // (double)sys_status.current_battery / 1000,sys_status.battery_remaining); + // 电压 + sprintf(buf, "%.2f", (double)sys_status.voltage_battery / 1000); + if (topicPubMsg[1] != buf) + { // 有更新 则更新数据 + topicPubMsg[1] = buf; + } // 电流 sprintf(buf, "%.2f", (double)sys_status.current_battery / 100); // 解构中 1=10毫安 所以这里/100 最终单位是A 安培 if (topicPubMsg[2] != buf) diff --git a/src/config.h b/src/config.h index 0a030d9..ce3bb26 100644 --- a/src/config.h +++ b/src/config.h @@ -29,7 +29,7 @@ // Moto-CAN //第二版本硬件参数---2号机使用 #define MOTO_CAN_RX 27 // PCB画板需要,做了调整 #define MOTO_CAN_TX 26 // PCB画板需要,做了调整 -#define WEIGHT_SCALE 49 // 减少零点漂移用B通道是41 实测改为49 +#define WEIGHT_SCALE 46 // 减少零点漂移用B通道是41 实测改为49 2026.1.7:实测: 44.75 #define HX711_GAIN 32 // 减少零点漂移用B通道的感度 #endif diff --git a/src/main.cpp b/src/main.cpp index 4845fe3..f848833 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,7 +106,7 @@ void setup() // ESP_LOGI(MOUDLENAME, "Starting PullupDevice... Ver:%s", VERSION); preferences.begin("PullupDev", false); wei_offset = preferences.getLong("wei_offset", 0); - // ESP_LOGD(MOUDLENAME, "wei_offset:%d", wei_offset); + // ESP_LOGD(MOUDLENAME, "wei_offset:%d", wei_offset); // addLogMessage("wei_offset: " + String(wei_offset)); // 初始化按钮