Blinking LED Programming Project For ATmega 8

post footer border
We all have seen the blinking lights in christmas and diwali. But very few of us really know or wanted to know how it works.

This Project helps you to make similar type of device by using ATmega8.

In this project we are using 8 LEDS and ATmega8 dev board v1.0 to make blinking LED device 

CODE :
#include<avr/io.h>
#include<util/delay.h>

main()
{
DDRD=0xFF; 
while(1)
{
PORTD=0b11111111;
    _delay_ms(100);
PORTD=0b00000000;
     _delay_ms(100);
}
}


Here <avr/io.h> is the avr Local directory 

We using <util/delay.h> for delay

DDRD=0xFF;  Here we using PORTD as Output port

_delay_ms(255);    we giving a delay of 100 milliseconds.




To download the whole Project ( including c source, asp and .hex ) Click here:

BlinkingLED.rar
BlinkingLED.rar




Recent Posts

AD Setting