Can I directly compare the BCD output from a ds1307 with another register or do I need to convert it to binary first?
i have a program that takes the time from the RTC and compares it with some "alarm" registrys that I have set up;
the ON and OFF registry are set at;
the alarm time display correctly on an lcd but the but the light only turn on when they should.
i have a program that takes the time from the RTC and compares it with some "alarm" registrys that I have set up;
C:
// **** Check Blue timer ***********
if (((hour >= ON_BLUE_hr)&&(minute >= ON_BLUE_min))&&((hour <= OFF_BLUE_hr)&&(minute <= OFF_BLUE_min)))
{
BLUE_L = 1;
}
else
{
BLUE_L = 0;
}
the ON and OFF registry are set at;
C:
unsigned int ON_BLUE_hr = 0b00001000;
unsigned int ON_BLUE_min = 0b00000000;
unsigned int ON_MAIN_hr = 0b00001001;
unsigned int ON_MAIN_min = 0b00000000;
unsigned int OFF_MAIN_hr = 0b00100000;
unsigned int OFF_MAIN_min = 0b00000000;
unsigned int OFF_BLUE_hr = 0b00100000;
unsigned int OFF_BLUE_min = 0b00110000;
the alarm time display correctly on an lcd but the but the light only turn on when they should.