lcd_write_inst(lcd_addr | 0x80); // resume cursor location
}
if (Alarm1Enable)
{
if ((AlarmTime1.hourh == CurrentTime.hourh) & (AlarmTime1.hourl == CurrentTime.hourl)
& (AlarmTime1.minuteh == CurrentTime.minuteh) & (AlarmTime1.minutel == CurrentTime.minutel)
& (AlarmTime1.secondh == CurrentTime.secondh) & (AlarmTime1.secondl == CurrentTime.secondl))
{
Alarm1Alarm = true;
CCP1CON = PWM_on;
BackLightEn = 0;
}
if (Alarm1Cnt > 120) // two minutes
{
Alarm1Alarm = false;
Alarm1Cnt = 0;
BackLightEn = 1;
BackLightTimer = 0;
}
}
else
{
Alarm1Alarm = false;
Alarm1Cnt = 0;
}
if (Alarm2Enable)
{
if ((AlarmTime2.hourh == CurrentTime.hourh) & (AlarmTime2.hourl == CurrentTime.hourl)
& (AlarmTime2.minuteh == CurrentTime.minuteh) & (AlarmTime2.minutel == CurrentTime.minutel)
& (AlarmTime2.secondh == CurrentTime.secondh) & (AlarmTime2.secondl == CurrentTime.secondl))
{
Alarm2Alarm = true;
CCP1CON = PWM_on;
BackLightEn = 0;
}
if (Alarm2Cnt > 120) // two minutes
{
Alarm2Alarm = false;
Alarm2Cnt = 0;
BackLightEn = 1;
BackLightTimer = 0;
}
}
else
{
Alarm2Alarm = false;
Alarm2Cnt = 0;
}
}
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
本文关键字:程序 C语言 PIC单片机,单片机-工控设备 - PIC单片机