'How to interpret a sensor value with non multiple of 8 bit number
I am trying to make my sensor more accurate, but after calibrating it I run into the problem that I don't know how to read what it measures now. For a 16-bit value I can just use
angY=i2c.mem_read(2,0x68,0x45)
VangY=(int(angY[0])*256+int(angY[1]))
but now I add an additional bit to the right, how should I read it ? I can't make it count as half, it would be useless.
Solution 1:[1]
I guess I just have to make my last bit count as 1 and multiply the rest by 2.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MasterH2O |
