#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>
void perfect1()
{
// data for common cathode
PORTC=0x00; _delay_ms(5000); //o
PORTC=0x01; _delay_ms(5000); //1
PORTC=0x02; _delay_ms(5000); //2
PORTC=0x03; _delay_ms(5000); //3
PORTC=0x04; _delay_ms(5000); //4
PORTC=0x05; _delay_ms(5000); //5
PORTC=0x06; _delay_ms(5000); //6
PORTC=0x07; _delay_ms(5000); //7
////PORTC=0x07; _delay_ms(1000);
//
//
PORTC=0x08; _delay_ms(5000); //8
PORTC=0x09; _delay_ms(5000); //9
}
int main()
{
DDRC=0xFF; // For LEDS
DDRB=0xFF; // For FAN Speed LEDs
while(1)
{
PORTB=0b00000001; perfect1(); _delay_ms(150);
PORTB=0b00000010; perfect1(); _delay_ms(150);
PORTB=0b00000100; perfect1(); _delay_ms(150);
PORTB=0b00001000; perfect1(); _delay_ms(150);
}
}