-
One LED not light up
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.
-
Re: One LED not light up
1. This is a PicBasic Forum and not C.
2. The above compiler does not support 24 or 32 series PICs.
3. Maybe your PortA is input only, so check your PICs datasheet.
Ioannis
-
Re: One LED not light up
Very likely porta for led 4 is an open collector port. In such a case, you just need to change the way the led is connected.
(Check the data sheet for confirmation)
Cheers
Al.