How about friends again, they already answered my question, but I work on a compiler of C, now I'm programming on pic C compiler, but it marks me that the second loop becomes infinite (it's always true, it executes normal, but at end begins to turn on the LEDs very randomly), just changing the variable ja SIGNED if it works (I'm doing the classic example of the "fantastic car") I do not understand why, someone will know what is due ??
#include<16f886.h>
#fuses xt,nowdt
#use delay(clock=4M)
#use standard_io(b)
int vec[8]={1,2,4,8,16,32,64,128};
int j=0,i=0;
void main(){
{
for(i=0;i<=7;i++)
{
output_b(vec[i]);
delay_ms(200);
}
for(j=7;j>=0;j--)
{
output_b(vec[j]);
delay_ms(200);
}
}
/// The error: Warning 203 "Vector.c" Line 19 (1,1); Condition always TRUE // Memory usage /// 0 errors, 1 warning
How they answered me in my last question if it works (j> = 0), but as long as j is SIGNED, it is worth mentioning that this concept of placing the signed I found in an example similar to mine, and I do not know why it works, can someone explain it to me? . Thanks in advance