1.2. Experiment to turn on/off using BIT

In this experiment led is connected to PORTC will be turned on and off with the instruction BIT

# include <mega8535.h>
# include <delay.h>

// Declare your global variables here

void main(void)
{
DDRC=0XFF;
while (1)
{
// Place your code here
PORTC.0=0;
delay_ms(100);
PORTC.0=1;
delay_ms(100);

};
}

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>