aniketkarajgikar
Newbie level 1
- Joined
- Mar 26, 2015
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 9
I am taking input of start time of any device from keypad and comparing it with current time of RTC. When current time matches RTC, LED will be ON.
I am using following logic.
consider inputs of minutes from keypad as mindecimal and minunit.
mindecimal=readkey();//to read key from keypad
minunit=readkey();//to read key from keypad
and RTC's minute will be
min=get_time(1);// function to read minutes from RTC
Now for comparing,
x=((min&0x70)>>4);
y=mindecimal - 0x30;
p=(min&0x0F);
q=minunit - 0x30;
if(x==y)
{
if(p==q)
{
//glow LED
}
}
But logic not working correctly.
Please Help.
I also want to do it for stop time.
Please Help.
Using MPLAB with xc8 compiler, pic18f4550 with ds1307 i2c bus
I am using following logic.
consider inputs of minutes from keypad as mindecimal and minunit.
mindecimal=readkey();//to read key from keypad
minunit=readkey();//to read key from keypad
and RTC's minute will be
min=get_time(1);// function to read minutes from RTC
Now for comparing,
x=((min&0x70)>>4);
y=mindecimal - 0x30;
p=(min&0x0F);
q=minunit - 0x30;
if(x==y)
{
if(p==q)
{
//glow LED
}
}
But logic not working correctly.
Please Help.
I also want to do it for stop time.
Please Help.
Using MPLAB with xc8 compiler, pic18f4550 with ds1307 i2c bus