求大神!STM32智能窗户中 HC SR501人体红外感应 DHT11温湿度传感器调试 冲突 单开单关都可以 定义都有 应该都没问题
放一起就重复开关窗 红外感应模块、温湿度传感器一直输出高电平 怎么可以解决 用的STM32F103C8T6 希望有人可以帮忙解答一下是不是我这段运行的程序有问题 看了好几天了
if((Gas_Dat < Gas_Thre) && (!Window_Open_Flag))
{
Window_Open_Flag = 1;Window_Close_Flag = 0;
Gui_DrawFont_GBK16(10,110,WHITE,BLUE,"wind open");
Motor_Ctrl_Func(1,3,250);
delay_nms(50);
}
else{
if((HC_SR501_StateRead() == 1) && (!Window_Close_Flag))
{
Window_Open_Flag = 0;Window_Close_Flag = 1;
Gui_DrawFont_GBK16(10,110,WHITE,BLUE,"wind close");
Motor_Ctrl_Func(2,3,250);
delay_nms(50);
}
if((U8RH_data_H > Hum_Thre) && (!Window_Close_Flag)
{
Window_Open_Flag = 0;Window_Close_Flag = 1;
Gui_DrawFont_GBK16(10,110,WHITE,BLUE,"wind close");
Motor_Ctrl_Func(2,3,250);
delay_nms(50);
}
}
|