Conditional Statement Help Request

AWOL "lp" is the output from the potentiometer "lp1" and "lp2" are check numbers for current and previous states. The first block of "if" statements simplifies the output the second prints an output based on it.

PaulS All variables are local. I intended to initialize both "lp1" and "lp2" in that first section though not assign a value to them. The first block assigns a value to "lp1" based on the potentiometers position and the second checks it against "lp2" since the first time "lp2" has no value lp1 != lp2 would evaluate to true and asign a value to "lp2" which would be checked the next time around. Assuming that the potentiometer has not moved it should evaluate to false and since I used &&(AND) not ||(OR) it should not execute the code.