Program to blink all LEDs connected in PORTC for Atmega 8535 MC

#include<avr/io.h>        //This is the header for AVR Microcontroller.
#include”delay.h”       //This is the working header file for delay.

int main(void)
{
    PORTC=0X00;            //PortC initiallization as all bits low.
    DDRC=0XF0;            //PortC data direction declaration as out put.
    
    while(1)            //This is for the the infinity loop.
    {    
        PORTC=0xF0;        //Turning ON all LED
        delayms(1000);    //Delay of 1sec
        PORTC=0x00;        //Turning OFF all LED
        delayms(1000);  //Delay of 1sec
    }
}

by

KSTRONICS7

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s