Código:
int count;
char ps[8]={0b0001,0b0011,0b0010,0b0110,0b0100,0b1100,0b1000,0b1001};
void main()
{
ANSEL=0;
ANSELH=0;
TRISC=0;
TRISA=0b11;
count=1;
while(1)
{
if(PORTA==0b01)
{
count++;
PORTC=ps[count];
if(count==9)
count=1;
}
if(PORTA==0b10)
{
count--;
PORTC=ps[count];
if(count==0)
count=8;
}
}
}
[/b]char ps[8]={0b0001,0b0011,0b0010,0b0110,0b0100,0b1100,0b1000,0b1001};
void main()
{
ANSEL=0;
ANSELH=0;
TRISC=0;
TRISA=0b11;
count=1;
while(1)
{
if(PORTA==0b01)
{
count++;
PORTC=ps[count];
if(count==9)
count=1;
}
if(PORTA==0b10)
{
count--;
PORTC=ps[count];
if(count==0)
count=8;
}
}
}
Saludos!!