@@ -910,31 +910,31 @@ def get_accel_data(self):
910
910
self .get_raw_accel_data ()
911
911
self .conv_accel_data ()
912
912
913
- def conv_accel_data (self ):
914
- """!
915
- Converts raw acceleration data according to the range setting and
916
- stores it
917
- """
918
- accel_range = self ._i2c .readByte (self .address , self .KX13X_CNTL1 )
919
- accel_range &= 0x18
920
- accel_range = accel_range >> 3
921
-
922
- if accel_range == self .KX132_RANGE2G :
923
- self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_2G , 6 )
924
- self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_2G , 6 )
925
- self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_2G , 6 )
926
- elif accel_range == self .KX132_RANGE4G :
927
- self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_4G , 6 )
928
- self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_4G , 6 )
929
- self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_4G , 6 )
930
- elif accel_range == self .KX132_RANGE8G :
931
- self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_8G , 6 )
932
- self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_8G , 6 )
933
- self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_8G , 6 )
934
- elif accel_range == self .KX132_RANGE16G :
935
- self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_16G , 6 )
936
- self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_16G , 6 )
937
- self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_16G , 6 )
913
+ def conv_accel_data (self ):
914
+ """!
915
+ Converts raw acceleration data according to the range setting and
916
+ stores it
917
+ """
918
+ accel_range = self ._i2c .readByte (self .address , self .KX13X_CNTL1 )
919
+ accel_range &= 0x18
920
+ accel_range = accel_range >> 3
921
+
922
+ if accel_range == self .KX132_RANGE2G :
923
+ self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_2G , 6 )
924
+ self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_2G , 6 )
925
+ self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_2G , 6 )
926
+ elif accel_range == self .KX132_RANGE4G :
927
+ self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_4G , 6 )
928
+ self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_4G , 6 )
929
+ self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_4G , 6 )
930
+ elif accel_range == self .KX132_RANGE8G :
931
+ self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_8G , 6 )
932
+ self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_8G , 6 )
933
+ self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_8G , 6 )
934
+ elif accel_range == self .KX132_RANGE16G :
935
+ self .kx132_accel .x = round (self .raw_output_data .x * self .CONV_16G , 6 )
936
+ self .kx132_accel .y = round (self .raw_output_data .y * self .CONV_16G , 6 )
937
+ self .kx132_accel .z = round (self .raw_output_data .z * self .CONV_16G , 6 )
938
938
939
939
940
940
class QwiicKX134 (QwiicKX13XCore ):
0 commit comments