The datasheet for the accelerometer states that:
Here is the data output from the accelerometer:
I have tried to mask the first two bits using a bitwise AND command with B0011111111111111.
I tried to use this code, but unfortunately the first 2 bits are still "11" so the value has not changed:
int bresult=0b0011111111111111&result; Serial.print(bresult,BIN);
How would I bits mask the first two bits and will arduino automatically know how to convert to twos compliment?
The variable result is of data type "long"
According to an answer, I tried:
int bresult= result<<2; Serial.print(bresult,BIN);
I got this result which is great but is it possible to remove the last two zeros because this is making my value larger? The image below shows result then bresult.