File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 50
50
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LSM6DSOX.git"
51
51
from time import sleep
52
52
from micropython import const
53
+ from math import radians
53
54
import adafruit_bus_device .i2c_device as i2c_device
54
55
from adafruit_register .i2c_struct import ROUnaryStruct , Struct
55
56
from adafruit_register .i2c_bits import RWBits
95
96
_LSM6DS_TAP_CFG = const (0x58 )
96
97
97
98
_MILLI_G_TO_ACCEL = 0.00980665
98
- _DPS_TO_RADS = 0.017453293
99
99
100
100
101
101
class CV :
@@ -296,10 +296,7 @@ def acceleration(self):
296
296
def gyro (self ):
297
297
"""The x, y, z angular velocity values returned in a 3-tuple and are in radians / second"""
298
298
raw_gyro_data = self ._raw_gyro_data
299
- x = self ._scale_gyro_data (raw_gyro_data [0 ]) * _DPS_TO_RADS
300
- y = self ._scale_gyro_data (raw_gyro_data [1 ]) * _DPS_TO_RADS
301
- z = self ._scale_gyro_data (raw_gyro_data [2 ]) * _DPS_TO_RADS
302
-
299
+ x , y , z = [radians (self ._scale_gyro_data (i )) for i in raw_gyro_data ]
303
300
return (x , y , z )
304
301
305
302
def _scale_xl_data (self , raw_measurement ):
You can’t perform that action at this time.
0 commit comments