From 656c850abb33c20077ce42714e8fbecec3ecc06f Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:46:28 +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=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=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:构建过程或辅助工具的变动 --- src/config.h | 2 +- src/main.cpp | 6 +++--- src/motocontrol.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/config.h b/src/config.h index c94d459..685af4e 100644 --- a/src/config.h +++ b/src/config.h @@ -4,7 +4,7 @@ /// // #define VERSION "0.90" // 软件版本 -#define VERSION_HW 1 // 硬件版本1:第一块硬件 2:目前版本 +#define VERSION_HW 2 // 硬件版本1:第一块硬件 2:目前版本 // 硬件接口定义//////////////////////////// // 按钮 #define BTN_UP 23 // 收线开关 接线:BTN_UP---GND diff --git a/src/main.cpp b/src/main.cpp index dd13ba1..862ca92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -398,6 +398,7 @@ void set_locked(bool locked) // 在核心1上执行,重要的延迟低的 void loop() { + fc.logln("loop"); // sercomm.getcommand(); // 得到控制命令 button_checktop.tick(); // 按钮 button_down.tick(); // 按钮 @@ -429,9 +430,8 @@ void loop() } } } - check_tare(); // 检查看是否需要校准称重 - // 检测执行初始化工作 - checkinited(); + check_tare(); // 检查看是否需要校准称重 + checkinited(); // 检测执行初始化工作 delay(1); } // 在核心0上执行耗时长的低优先级的 diff --git a/src/motocontrol.h b/src/motocontrol.h index 332e656..4dc1dc7 100644 --- a/src/motocontrol.h +++ b/src/motocontrol.h @@ -4,8 +4,9 @@ #include "moto.h" #include -#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 -#define WHEEL_DIAMETER 3.8 // 轮子直径cm +#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 +// #define WHEEL_DIAMETER 3.8 // 轮子直径cm +#define WHEEL_DIAMETER 2.3 // 轮子直径cm 小轮子直径 #define WHEEL_PERIMETER (WHEEL_DIAMETER * 3.1416) // 轮子周长 #define ROPE_MAXCOUNT (ROPE_MAXLENGTH / WHEEL_PERIMETER) // 最大圈数