//8x8 Dotmatrix scanning
void setup() {
  // put your setup code here, to run once:
  volatile char *dirf,*dirl;
  volatile char *outf,*outl; 

  dirf=0x30;
  dirl=0x10A;
  outf=0x31;
  outl=0x10B;

  *dirf=0xFF;
  *dirl=0xFF;

  char row=0,col=0;
  while(1)
  {
    for(row=0;row<8;row++)
    {
      *outl=~(1<<row);
      for(col=0;col<8;col++)
      {
        *outf=1<<col;
        delay(500);
      }
    } 
  }
}