programmer36
Newbie level 5
Hi all,
My 1st post asking help/guidance. Thanks for the opportunity.
Can anyone identify any mistakes in this coding? Its for dig clock with 16f877a.
My 1st post asking help/guidance. Thanks for the opportunity.
Can anyone identify any mistakes in this coding? Its for dig clock with 16f877a.
Code:
interrupt isr(void)
{
if(INTF)
{
while(!RB0)
{
while(RB0)
{
if (!RB7)
{
while(!RB7);
if(Hour<12)
Hour++;
else
Hour=1;
let[5]= (Hour/10) +0x30;
let[6]= (Hour%10) +0x30;
PORTD=0XC0;
lcd_write();
write_let();
}
if (!RB6)
{
while(!RB6);
if(Hour>1)
Hour--;
else
Hour=12; `12;
let[5]= (Hour/10) +0x30;
let[6]= (Hour%10) +0x30;
PORTD=0XC0;
lcd_write();
write_let();
}
if (!RB5)
{
while(!RB5);
if(Minute<59)
Minute++;
else
Minute=0;
let[8]= (Minute/10) +0x30;
let[9]= (Minute%10) +0x30;
PORTD=0XC0;
lcd_write();
write_let();
}
if (!RB4)
{
while(!RB4);
if(Minute>0)
Minute--;
else
Minute=59;
let[8]= (Minute/10) +0x30;
let[9]= (Minute%10) +0x30;
PORTD=0XC0;
lcd_write();
write_let();
}
}
}
INTF=0;
}
}