按K,A亮,再按K,B亮,A灭,下面程序不工作,能编译,求指点?谢谢
void main()
{
int i=0;
TRISA=0x04;
TRISC=0x00;
//PORTC=0x01;//RC0输出高电平
//PORTC=0x00;
TRISB=0x00;
PORTB=0xF0;//RB4-RB7输出高电平
ANSEL=0x00;
ANSELH=0x00;
while(1)
{
if(RA2==0)
{
//Delay(5);
//if(RA2==0)
i++;
if(i==1)
{
RC0=1;
RC1=0;
Delay(500);
}
if(i==2)
{
RC1=1;
RC0=0;
Delay(500);
i=0;
}
}
}
}