Skip to content

Commit d3edbc3

Browse files
authored
Merge pull request #35 from caternuson/iss34
Change to gyro and rads/sec
2 parents cc0b08c + d3bd4e7 commit d3edbc3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

adafruit_bno055.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ class BNO055:
108108
magnetic = _ScaledReadOnlyStruct(0x0e, '<hhh', 1/16)
109109
"""Gives the raw magnetometer readings in microteslas."""
110110
gyroscope = _ScaledReadOnlyStruct(0x14, '<hhh', 1/16)
111-
"""Gives the raw gyroscope reading in degrees per second."""
111+
"""Gives the raw gyroscope reading in degrees per second.
112+
113+
.. warning:: This is deprecated. Use ``gyro`` instead. It'll work with
114+
other drivers too."""
115+
gyro = _ScaledReadOnlyStruct(0x14, '<hhh', 0.001090830782496456)
116+
"""Gives the raw gyroscope reading in radians per second."""
112117
euler = _ScaledReadOnlyStruct(0x1a, '<hhh', 1/16)
113118
"""Gives the calculated orientation angles, in degrees."""
114119
quaternion = _ScaledReadOnlyStruct(0x20, '<hhhh', 1/(1<<14))

examples/bno055_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
print('Temperature: {} degrees C'.format(sensor.temperature))
1111
print('Accelerometer (m/s^2): {}'.format(sensor.accelerometer))
1212
print('Magnetometer (microteslas): {}'.format(sensor.magnetometer))
13-
print('Gyroscope (deg/sec): {}'.format(sensor.gyroscope))
13+
print('Gyroscope (rad/sec): {}'.format(sensor.gyro))
1414
print('Euler angle: {}'.format(sensor.euler))
1515
print('Quaternion: {}'.format(sensor.quaternion))
1616
print('Linear acceleration (m/s^2): {}'.format(sensor.linear_acceleration))

0 commit comments

Comments
 (0)