This commit is contained in:
玖叁 2024-12-18 21:52:05 +08:00
parent 3452b05333
commit 6869433db2
1 changed files with 13 additions and 0 deletions

View File

@ -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;
}