This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bit comparison Error

Hello everyone,

I'm receiving 8 bytes, the  first 4 bytes are errors data and the others are for the warnings.

Each bit represent a different error or warning so im trying to figure out which bits are set so i can find out which errors i have.

i'm doing a logical comparison in order to find out the result of that bit.

if(errorMask == ((rxMsgDataAux[byte])&&(errorMask)))

My error mask is 0b00000001 and each time i shift it one to the left

for some reason, for example if rxMsgDataAux[0] = 0x0f the comparison works as it should in the first time , but the second time it does not enter on the if condition.

does anyone have any idea about what could be the problem ?

Thanks