From 3ff2e4eecebdd6e47e0feb669e3d98cb41920794 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 1 Mar 2022 09:12:01 +0000 Subject: [PATCH] Update lis3dh.py --- lis3dh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lis3dh.py b/lis3dh.py index 8865725..770083e 100644 --- a/lis3dh.py +++ b/lis3dh.py @@ -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: