#define F_CPU 12000000L
#include <avr/io.h>
#include <util/delay.h>


unsigned int data[]=
{

0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,

0b00000000,

0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,

0b00000000,

0b00011100,
0b00111110,
0b00011111,
0b00111110,
0b00011100,

0b00000000,
0b00000000,

0b00011111,
0b00101000,
0b01001000,
0b00101000,
0b00011111,

0b00000000,

0b01111111,
0b00000001,
0b00000001,
0b00000001,
0b00000001,

0b00000000,

0b01111111,
0b00000001,
0b00000001,
0b00000001,
0b00000001,

0b00000000,

0b01111111,
0b01001001,
0b01001001,
0b01001001,
0b01001001,

0b00000000,

0b01111111,
0b00010000,
0b00001000,
0b00000100,
0b01111111,

0b00000000,

0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,

0b00000000,

0b00011111,
0b00101000,
0b01001000,
0b00101000,
0b00011111,

0b00000000,

0b01111111,
0b00010000,
0b00001000,
0b00000100,
0b01111111,

0b00000000,

0b01000000,
0b01000000,
0b01111111,
0b01000000,
0b01000000,

0b00000000,

0b00111110,
0b01000001,
0b01000001,
0b01000001,
0b00111110,

0b00000000,

0b01111111,
0b00010000,
0b00001000,
0b00000100,
0b01111111,

0b00000000,

0b01110000,
0b00001000,
0b00000111,
0b00001000,
0b01110000,

0b00000000,
0b00000000,

0b00011100,
0b00111110,
0b00011111,
0b00111110,
0b00011100,

0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,

0b00000000,

0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,

0b00000000


};

uint16_t size=110;
uint16_t position=0;
unsigned int screen1[]={0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000};
unsigned int screen2[]={0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000};

void calculate()
 {
  int k;
  for(k=0;k<8;++k)
   {
     screen1[k]=data[position+k];
	 screen2[k]=data[position+k+8];
   } 
 }
 
void display()
 {
   int m,n;
   for(m=0;m<8;++m)
    {
	 	PORTB=0x00;
		PORTA=0x00;
		PORTC=0x00;
		_delay_us(250);
		PORTC=~screen1[m];
		PORTB|=(0x01<<m);
		_delay_us(800);
	}
   for(n=0;n<8;++n)
    {	
	    PORTB=0x00;
		PORTA=0x00;
		PORTC=0x00;
		_delay_us(250);
		PORTC=~screen2[n];
		PORTA|=(0x01<<n);
		_delay_us(800);
	}
		
 } 

int main(void)
{

 DDRB=0xFF;
 DDRA=0xFF;
 DDRC=0xFF;
 PORTB=0x00;
 PORTA=0x00;
 PORTC=0xFF;
 _delay_ms(10);
 int i=0;
 while(1)
  {
  i=0;
  
  if(position>(size-17))
	position=0;
	
  calculate();
	 
  while(i<10)
   {
     display();
	 ++i;
   }
   ++position;
   
  }
 
return 0;
}

	

   
	
  
 

