You are on page 1of 3

#include <delay.

h>
// Declare your global variables here
void main(void)
{ unsigned int i, col,cil;
unsigned char nol[8]=
{0xFF,0x00,0x7F,0xFF,0x98,0x98,0xFF,0x7F

};
unsigned char nil[8]=
{0x07,0x04,0x0E,0x04,0x04,0x0C,0x04,0xF8
};
DDRC=0xFF;
DDRD=0xFF;
PORTC=1;
PORTD=1;
DDRA=0xFF;
DDRB=0xFF;
PORTA=1;
PORTB=1;

while (1)
{

i=0;
for (col=1;col<256;col=col*2)
{PORTD=col;
PORTC=~nol[i];
i=i+1;
delay_ms(1);}
i=0;
for (cil=1;cil<256;cil=cil*2)
{PORTB=cil;
PORTA=~nil[i];
i=i+1;
delay_ms(1);}
};
}
11
/*****************************************************
This program was produced by the
CodeWizardAVR V2.04.4a Advanced
Automatic Program Generator
Copyright 1998-2009 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date : 27/04/2014
Author : NeVaDa
Company :
Comments:
Chip type : ATmega8535
Program type : Application
AVR Core Clock frequency: 12,000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 128
*****************************************************/
#include <mega8535.h>
#include <delay.h>
// Declare your global variables here
void main(void)
{ unsigned int i, col,cil;
unsigned char nol[8]=
{0x7C,0x02,0x3E,0x02,0x7C,0x00,0x7E,0x00

};
unsigned char nil[8]=
{0x07,0x04,0x0E,0x04,0x04,0x0C,0x04,0xF8
};
DDRC=0xFF;
DDRD=0xFF;
PORTC=1;
PORTD=1;
DDRA=0xFF;
DDRB=0xFF;
PORTA=1;
PORTB=1;

while (1)
{

i=0;
for (col=1;col<256;col=col*2)
{PORTD=col;
PORTC=~nol[i];
i=i+1;
delay_ms(0.5);}
i=0;
for (cil=1;cil<256;cil=cil*2)
{PORTB=cil;
PORTA=~nil[i];
i=i+1;
delay_ms(0.5);}
};
}
22
#include <mega16.h>
#include <delay.h>
// Declare your global variables here
void main(void)
{ unsigned int i, col,cil;
unsigned char nol[8]=
{0x02,0x06,0x08,0x1C,0x08,0x28,0x28,0x12

};
unsigned char nil[8]=
{0x02,0x0C,0x70,0x00,0x7E,0x00,0x30,0x48
};
DDRC=0xFF;
DDRD=0xFF;
PORTC=1;
PORTD=1;
DDRA=0xFF;
DDRB=0xFF;
PORTA=1;
PORTB=1;

while (1)
{

i=0;
for (col=1;col<256;col=col*2)
{PORTD=col;
PORTC=~nol[i];
i=i+1;
delay_ms(1);}
i=0;
for (cil=1;cil<256;cil=cil*2)
{PORTB=cil;
PORTA=~nil[i];
i=i+1;
delay_ms(1);}
};
}

You might also like