void setup()
{
volatile char *dirf,*outf;
volatile char *dirk,*ink;
dirf=0x30; outf=0x31;
dirk=0x107; ink=0x106;
*dirf=0xFF; *ink=0x00;
volatile char switches;
volatile long arr[]={63,6,91,79,102,109,125,7,127,111};
volatile long i,j,k,count=8;
loop: while(1)
{
*outf=arr[9];
switches=*ink;
if((switches & 2) == 2)
{
*outf=arr[count];// to display
for(j=0;j<=200000;j++);// delay to watch numbers
count--;// decrementing count value for array element access
if(count==-1) count=8;// reinitializing count to 8 to restart
goto loop;
}
}
}
void loop()
{
}