From 148e235523dac6fdfca5e99f52550006223b599b Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Tue, 1 Apr 2025 19:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Atest=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E6=B5=8B=E8=AF=95=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91?= =?UTF-8?q?=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- platformio.ini | 2 +- src/config.h | 20 +++++++++----------- src/main.cpp | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/platformio.ini b/platformio.ini index 913d3b9..670ea2f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,7 @@ platform = espressif32 board = esp32doit-devkit-v1 framework = arduino -monitor_speed = 115200 +monitor_speed = 57600 upload-port = COM[14] lib_deps = bogde/HX711@^0.7.5 diff --git a/src/config.h b/src/config.h index 834b891..0224619 100644 --- a/src/config.h +++ b/src/config.h @@ -3,7 +3,7 @@ // 定义公共结构,变量,硬件接口等 /// // -#define VERSION "0.90" //版本 +#define VERSION "0.90" // 版本 // 硬件接口定义//////////////////////////// // 按钮 #define BTN_UP 23 // 收线开关 接线:BTN_UP---GND @@ -11,26 +11,24 @@ #define BTN_CT 21 // 到顶检测开关 #define BTN_TEST 18 // 测试开关 // 称重传感器- HX711 -#define LOADCELL_DOUT_PIN 13 //16 -#define LOADCELL_SCK_PIN 33 //17 +#define LOADCELL_DOUT_PIN 13 // 16 +#define LOADCELL_SCK_PIN 33 // 17 /////////////////////////////////////////// #define SERVO_PIN 14 // 锁定舵机PWM控制脚 ////LED #define LED_DATA_PIN 25 // Moto-CAN -#define MOTO_CAN_RX 26 -#define MOTO_CAN_TX 27 -///serial1 +#define MOTO_CAN_RX 27 +#define MOTO_CAN_TX 26 +/// serial1 #define SERIAL_REPORT_TX 5 #define SERIAL_REPORT_RX 18 ///// -#define WEIGHT_SCALE 165 // 276 //这是缩放值,根据砝码实测516.f -#define TM_INSTORE_WEIGHT_DELAY 200 //200 // 入仓动力延时关闭时间 ms -#define TM_INSTORE_DELAY_WEIGHT 200 // 入仓动力延时关闭时间生效的重量(g),免得空钩也延时关闭导致线拉紧 ms +#define WEIGHT_SCALE 165 // 276 //这是缩放值,根据砝码实测516.f +#define TM_INSTORE_WEIGHT_DELAY 200 // 200 // 入仓动力延时关闭时间 ms +#define TM_INSTORE_DELAY_WEIGHT 200 // 入仓动力延时关闭时间生效的重量(g),免得空钩也延时关闭导致线拉紧 ms #define TM_INSTORE_NOWEIGHT_DELAY 50 // 空钩完全不延时也可能顶部按键按不下去,加一点延时 ms - - enum HookStatus { HS_UnInit, // 还未初始化 diff --git a/src/main.cpp b/src/main.cpp index 1b7175b..2ed0dc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,7 +109,7 @@ const uint16_t MAV_CMD_FC_HOOK_RECOVERY = 43; // 飞控发的---收线 // char* password = (char*)"12345678"; //wifi密码 char *ssid = (char *)"flicube"; // wifi帐号 char *password = (char *)"fxmf0622"; // wifi密码 -char *mqttServer = (char *)"152.32.162.75"; //"szdot.top"; //mqtt地址 +char *mqttServer = (char *)"szdot.top"; //"szdot.top"; //mqtt地址 int mqttPort = 1883; // mqtt端口 char *mqttName = (char *)"admin"; // mqtt帐号 char *mqttPassword = (char *)"123456"; // mqtt密码