hi all,
i trying to make a running light LED on dsPIC33FJ64MC802 and this is my code
Code:
void main (void){
TRISA=0x0000; //portA as output
unsigned int data;
unsigned int n;
unsigned int m;
while (1){
data=0x01;
for(n=0;n<5;n++){ //make a loop for led to on
LATA=data; //to confugure which led to on
data=data<<1; //change the value in data
delay1s();
}
data=0x10; //Change value in data to make led light on backwork
for(m=0;m<5;m++){ //make a loop for led to on
LATA=data; //to confugure which led to on
data=data>>1; //change the value in data
delay1s();
}
}
}
my question is, why my LED 4 not light up while other run as what i want.
Bookmarks