You are on page 1of 2

#include <mega128.

h>
#include <delay.h>

void main(void)
{

int a,b;
unsigned char CW[8] = {0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09};
unsigned char CCW[8] = {0x09,0x01,0x03,0x02,0x06,0x04,0x0c,0x08};
PORTA=0x00;
DDRA=0xFF;
PORTC=0x00;
DDRC=0xFF;

while (1)
{
for (a=0;a<=7;a++)
{
PORTA=CW[a];
delay_ms(200);
}
for (b=0;b<=7;b++)
{
PORTA=CCW[a];
delay_ms(200);

}
}
}

You might also like