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);
};
}