I'm trying to write a code in which two conditionals must be meet in order to follow the cycle, but it's not working.
If ((control = 10000 || control = 80000) && if((P2IN&0x02)==0)
If I do this, it will give me an error while debugging, but I don't where the mistake is.
(control = 10000 || control = 80000)it will always evaluate to thetrueasyou assign the
controlwith10000and in C language any non zero value is considered astrue. The second part of the||will not be evaluated because of the shorthand evaluationYou should read the warning as the compiler definitely has warned you about it
You did not get to the debugging as this code would not compile. The second part is invalid as you do not need the second
if(invalid syntax)It should be
if ((control == 10000 || control == 80000) && !(P2IN & 0x02))