What does >>= do in this example?
byte fsr = 2;
fsr >>= 2;
I came across it here: https://github.com/sparkfun/MMA8452_Accelerometer/blob/master/Firmware/MMA8452Q_BasicExample/MMA8452Q_BasicExample.ino
What does >>= do in this example?
byte fsr = 2;
fsr >>= 2;
I came across it here: https://github.com/sparkfun/MMA8452_Accelerometer/blob/master/Firmware/MMA8452Q_BasicExample/MMA8452Q_BasicExample.ino
It does this:
fsr = fsr >> 2;
fsr >>= 2;
is
fsr = fsr >> 2;
In Bitwise Context, two bit places to the right is being shifted.
In Arithmetic context, the number in fsr is being divided by 2^2(4);