Skip to content

Commit 24224cc

Browse files
authored
Merge pull request #14 from adafruit/rads_fix
change from dps->rads for gyro to fix #9
2 parents cbc8c46 + 472b71b commit 24224cc

7 files changed

+8
-128
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Usage Example
6969
7070
while True:
7171
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sox.acceleration))
72-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sox.gyro))
72+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s"%(sox.gyro))
7373
print("")
7474
time.sleep(0.5)
7575

adafruit_lsm6ds.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
__version__ = "0.0.0-auto.0"
5050
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LSM6DSOX.git"
5151
from time import sleep
52+
from math import radians
5253
from micropython import const
5354
import adafruit_bus_device.i2c_device as i2c_device
5455
from adafruit_register.i2c_struct import ROUnaryStruct, Struct
@@ -293,12 +294,9 @@ def acceleration(self):
293294

294295
@property
295296
def gyro(self):
296-
"""The x, y, z angular velocity values returned in a 3-tuple and are in degrees / second"""
297+
"""The x, y, z angular velocity values returned in a 3-tuple and are in radians / second"""
297298
raw_gyro_data = self._raw_gyro_data
298-
x = self._scale_gyro_data(raw_gyro_data[0])
299-
y = self._scale_gyro_data(raw_gyro_data[1])
300-
z = self._scale_gyro_data(raw_gyro_data[2])
301-
299+
x, y, z = [radians(self._scale_gyro_data(i)) for i in raw_gyro_data]
302300
return (x, y, z)
303301

304302
def _scale_xl_data(self, raw_measurement):

examples/lsm6ds_full_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
while True:
3030
print(
31-
"Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f degrees/s"
31+
"Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f radians/s"
3232
% (sensor.acceleration + sensor.gyro)
3333
)
3434
time.sleep(0.05)

examples/lsm6ds_ism330dhct_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
while True:
1111
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

examples/lsm6ds_lsm6ds33_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
while True:
1111
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

examples/lsm6ds_lsm6dsox_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
while True:
1111
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

register_map.json

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)