Byte comparison using equality operator

data = B11101100
MASK_STATE = B10000000

therefore...
data & MASK_STATE = B10000000

  if(data & MASK_STATE == MASK_STATE)
    Serial.println("is 1");
else
   Serial.println("is 0");

So how come I never see "is 1"

Even if i change the condition to: data & MASK_STATE == data & MASK_STATE i still can't get "is 1".

Instead of:

if(data & MASK_STATE == MASK_STATE)

Try:

if((data & MASK_STATE) == MASK_STATE)

Prints a 1 for me. It's a precedent of operation thingee I think.

Lefty

Thank you sir. You are indeed right: http://www.cs.uml.edu/~dm/course/91.201/s03/precedence_chart.htm