10个月前
// 读取左传感器(滤波后)
uint8_t Read_IR_Left_Filtered() {
static uint8_t history[3] = {1, 1, 1};
history[0] = history[1];
history[1] = history[2];
history[2] = Read_IR_Left(); // 原始读取函数
return (history[0] + history[1] + history[2]) >= 2; // 至少2次相同则有效
}


