Update lis3dh.py

This commit is contained in:
Kacper 2022-03-01 09:10:01 +00:00
parent f9082650ea
commit 2468ac039f

View file

@ -104,9 +104,9 @@ class lis3dh:
for D in [X,Y,Z]:
MSB = D >> 7
if MSB == 1:
res = -128 + (D - 128)
res = (-128 + (D - 128))/(128*self.resolution)
else:
res = D
res = D/(128*self.resolution)
new_values.append(res)
return new_values
else: