//***PIC16F628***
//Clock 4Mhz
//Compiler mikroC 5.0
//Describtion: Lookup data in table and show on PortB
unsigned short TBL[]={0b10000001,0b01000010,0b00100100,0b00011000,0b00010100,
0b00010010,0b00010001,0b00100001,0b01000001,0b10000001};
main()
{
int i;
TRISB=0; //Set PORTB is Output
PORTB=0B0000000; //Initial PORTB
i=0;
while(1)
{
PORTB=TBL[i];
Delay_ms(500);
i++; //Increment Index
if(i==10) //Reload
i=0;
}
}
|