Update lis3dh.py

This commit is contained in:
Kacper 2022-03-01 09:12:01 +00:00
parent 2468ac039f
commit 3ff2e4eece

View file

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