You are on page 1of 2

#include <mega8535.

h>

#include <delay.h>

void main(void) {

PORTA=0xFF;

DDRA=0xFF;

PORTC=0x00;

DDRC=0xFF;

while (1) {

PORTA=0B00000001;

PORTC=0x0;

delay_ms(500);

PORTA=0B00000010;

PORTC=0x1;

delay_ms(500);

PORTA=0B00000100;

PORTC=0x2;

delay_ms(500);

PORTA=0B00001000;

PORTC=0x3;

delay_ms(500);

PORTA=0B00010000;

PORTC=0x4;

delay_ms(500);

PORTA=0B00100000;
PORTC=0x5;

delay_ms(500);

PORTA=0B01000000;

PORTC=0x6;

delay_ms(500);

PORTA=0B10000000;

PORTC=0x7;

delay_ms(500); };

You might also like