From 6869433db268f6467de502f9250e7bc3a665aefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=8F=81?= Date: Wed, 18 Dec 2024 21:52:05 +0800 Subject: [PATCH] 1 --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index a10002d..5fc3a18 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ #define CMD_MOTOR_MOVE_CONTROL 0x20 #define CMD_MOTOR_ROTATE_CONTROL 0x21 #define CMD_MOTOR_SINGLE_CONTROL 0x22 +#define CMD_DEMO_PID 0xf0 // 全局变量 int currentSpeed = 0; // 当前速度 int turnOffset = 0; // 转向偏移量 (-100 到 100) @@ -346,6 +347,18 @@ void handleSerialPacket(uint8_t *packet, int length, BLECharacteristic &characte } break; + case CMD_DEMO_PID: + Serial.println("CMD_DEMO_PID"); + + // // 获取 PID 参数 + // unsigned int sensitivity = CarStorage::getSensitivity(); + // Serial.println("CMD_DEMO_PID, sensitivity: " + String(sensitivity)); + + // // 设置 PID 参数 + // CarStorage::setSensitivity(sensitivity + 1); + + break; + default: break; }