diff --git a/adafruit_lsm9ds1.py b/adafruit_lsm9ds1.py index f68cf33..72f9a5d 100644 --- a/adafruit_lsm9ds1.py +++ b/adafruit_lsm9ds1.py @@ -19,13 +19,14 @@ **Hardware:** -* Adafruit `9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS1 +* `Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS1 `_ (Product ID: 3387) **Software and Dependencies:** * Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads + * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice """ @@ -34,6 +35,7 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1.git" import time +from math import radians try: import struct @@ -302,10 +304,10 @@ def read_gyro_raw(self): @property def gyro(self): """The gyroscope X, Y, Z axis values as a 3-tuple of - degrees/second values. + rad/s values. """ raw = self.read_gyro_raw() - return map(lambda x: x * self._gyro_dps_digit, raw) + return map(lambda x: radians(x * self._gyro_dps_digit), raw) def read_temp_raw(self): """Read the raw temperature sensor value and return it as a 12-bit diff --git a/examples/lsm9ds1_simpletest.py b/examples/lsm9ds1_simpletest.py index 1f934f9..bad90df 100644 --- a/examples/lsm9ds1_simpletest.py +++ b/examples/lsm9ds1_simpletest.py @@ -40,7 +40,7 @@ "Magnetometer (gauss): ({0:0.3f},{1:0.3f},{2:0.3f})".format(mag_x, mag_y, mag_z) ) print( - "Gyroscope (degrees/sec): ({0:0.3f},{1:0.3f},{2:0.3f})".format( + "Gyroscope (rad/sec): ({0:0.3f},{1:0.3f},{2:0.3f})".format( gyro_x, gyro_y, gyro_z ) )