kappa_am
Full Member level 6
Hi,
I like to access to a single bit of a variable using another variable. I have write following code (red lines in following text), but it has errors. I would be grateful if you give me your recommendations.
I like to access to a single bit of a variable using another variable. I have write following code (red lines in following text), but it has errors. I would be grateful if you give me your recommendations.
Code:
....
while(1)
{
CHSL=0;
do{
for (ph=0; ph<3; ph++)
{
for (cap=0; cap<3; cap++)
{
ADRES=ADREAD(ph*3+cap);
ADRES=ADRES>>2;
[COLOR="#FF0000"] if(ADRES<REFC[ph][cap]) OUTM[ph].cap=0;
else if(ADRES>REFC[ph][cap]) OUTM[ph].cap=0 ;
else OUTM[Ph+2].cap=1;[/COLOR]
CHSL=CHSL+1;
}
}
} while(CHSL<10);
}
}