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,stopbit=1;
loop: while(1)
{
if(stopbit==0)
{
*outf=0;// off the display
break;
}
*outf=arr[9];
switches=*ink;
if((switches & 1) == 1)
{
j=9;
while(j>=0)
{
while(1)
{
switches=*ink;
if((switches & 2) == 2)
{
stopbit=0;
goto loop;
}
else
break;
}
*outf=arr[j];
for(k=0;k<=200000;k++);//delay
if(j==0)
{
j=9;
continue;
}
j--;
}
}
}
}
void loop()
{
}