1.1. Experiment turn on/off LED

In the following experiment portC functioned as an output and eight LED will turn on and off continuously, using delay subrutine.

# include <mega8535.h>
# include <delay.h>
// Declare your global variables here
void main(void)
{
PORTC=0XFF;
while (1)
{
// Place your code here
PORTC=0xFF;
delay_ms(1000);
PORTC=0×00;
delay_ms(1000);
};
}

This entry was posted in Tutorial AVR C Codevision. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>