Friday, May 17, 2013

LED FLASHING WITH ATMEGA32

HEY GUYS I HAD DEVELOPED FLASHING LED PROGRAM USING FLASHING LED PROGRAM BY USING ATMEGA-32.


#include <avr/io.h>
int main(void)
{
DDRC = 0b00001111;
PORTC = 0b00000000;
DDRD = 0b00001111;
PORTD = 0b00000000;
TCCR1B |= 1<<CS10 | 1<<CS11;
int LEDNumber[2];
while(1)
{
if (TCNT1 > 3906)
{
TCNT1 = 0;
PORTC = 1<<LEDNumber[0];
LEDNumber[0] ++;
if (LEDNumber[0] > 3)
{
LEDNumber[0] = 0;
PORTD = 1<<LEDNumber[1];
LEDNumber[1] ++;
if (LEDNumber[1] > 3)
LEDNumber[1] = 0;
}
}
}
}

1 comment:

  1. Play live casino site ᐈ 20+ slots from 20+ casinos worldwide!
    Best Live Casino Games The most popular live casino games include blackjack, roulette, baccarat, roulette, baccarat, craps, and luckyclub so much more. All

    ReplyDelete