well i got more problems.
I'm finally able to get the wanted pins to work. kinda. it goes. 0,1,2,3,3,2,1,0,0,0,0,0,0,0,etc
i used this to get it
up=0
down=3
if(up<=3)
{
PORT_ON(PORTD, up);
delay_cycles(8000);
PORT_OFF(PORTD, up++);
delay_cycles(8000);
}
else
{
PORT_ON(PORTD, down);
delay_cycles(8000);
PORT_OFF(PORTD, down--);
delay_cycles(8000);
}
}
fine that'll do, but i want to do it with the FOR loop. but i cant get it to go past 0,0,0,0,0
EDIT:
BOOYA got it to work. guess all i needed was some sleep
while(1)
{
for(int up = 0; up<=3; up++)
{
PORT_ON(PORTD, up);
delay_cycles(1000);
PORT_OFF(PORTD, up);
delay_cycles(1000);
}
for(int down = 3; down<=3;down--)
{
PORT_ON(PORTD, down);
delay_cycles(1000);
PORT_OFF(PORTD, down);
delay_cycles(1000);
if(down == 0)
break;
}
}