#include <16F628.h>
#use delay(clock=4000000)
#fuses XT,PUT,BROWNOUT,MCLR,NOWDT,NOPROTECT,NOLVP
#case
//Describtion: Lookup data in table and show on PortB
unsigned char TBL[]={0b10000001,0b01000010,0b00100100,0b00011000,0b00010100,
0b00010010,0b00010001,0b00100001,0b01000001,0b10000001};
void main(void)
{
unsigned char B;
int i;
set_tris_b(0B00000000); //RB is Output
i=0;
while(1)
{
B=TBL[i]; //Get data form table
output_b(B); //Out to PORTB
i++; //Increment Index
if(i==10) //Reset index
i=0;
delay_ms(300);
}
}
|