Hi guys
I recently bought an accelrometer and want to make a simple program that reads out the values in G's. I followed an online tutorial but i doesnt understand why the done this
readx = bus.read_byte_data(addr, OUT_X_L)
readx2 = bus.read_byte_data(addr, OUT_X_H)
x = readx | readx2 << 8
if x > 32767 :
x -= 65536
If sorry for the simple question but why do you need to sum the 2 values and then bit shift it 8 places?
and I assume the second part checks to see if the value is in range.
(In range of a 16 bit output)
thanks for the help