/*****************************************************
Project : Ritariässä
Version : 1
Date : 2.1.2008
Author : MORO VAA
Company :
Comments: Lyhyt ja ytimekäs ritariässä ohjelma.
Sytyttää LEDit porteissa: PD,PB,PC.
Chip type : AT90S4433
Clock frequency : 6,000000 MHz
*****************************************************/
#include <90s4433.h>
#include <delay.h>
void main(void)
{
unsigned char i, ledi;
PORTB=0x3F;
DDRB=0x3F;
PORTC=0x3F;
DDRC=0x3F;
PORTD=0xFF;
DDRD=0xFF;
ACSR=0x80;
ledi = 0x01;
while (1)
{
for(i = 0 ; i < 8; i++)
{
PORTD = ~ledi;
ledi <<= 1;
delay_ms(50);
}
PORTD = ~0x00;
ledi = 0x01;
for(i = 0; i < 6; i++)
{
PORTB = ~ledi;
ledi <<= 1;
delay_ms(50);
}
PORTB = ~0x00;
ledi = 0x01;
for(i=0; i < 6; i++)
{
PORTC = ~ledi;
ledi <<= 1;
delay_ms(50);
}
PORTC = ~0x00;
ledi = 0x20;
for(i = 0 ; i < 6; i++)
{
PORTC = ~ledi;
ledi >>= 1;
delay_ms(50);
}
PORTC = ~0x00;
ledi = 0x20;
for(i = 0; i < 6; i++)
{
PORTB = ~ledi;
ledi >>= 1;
delay_ms(50);
}
PORTB = ~0x00;
ledi = 0x80;
for(i=0; i < 8; i++)
{
PORTD = ~ledi;
ledi >>= 1;
delay_ms(50);
}
PORTD = ~0x00;
ledi = 0x01;
};
}