|
16 | 16 |
|
17 | 17 | **Hardware:**
|
18 | 18 |
|
19 |
| -* Adafruit `MPU-6050 6-DoF Accel and Gyro Sensor |
20 |
| - <https://www.adafruit.com/product/3886>`_ |
| 19 | +* `Adafruit MPU-6050 6-DoF Accel and Gyro Sensor |
| 20 | + <https://www.adafruit.com/product/3886>`_ (Product ID: 3886) |
21 | 21 |
|
22 | 22 | **Software and Dependencies:**
|
23 | 23 |
|
24 | 24 | * Adafruit CircuitPython firmware for the supported boards:
|
25 | 25 | https://circuitpython.org/downloads
|
| 26 | +
|
26 | 27 | * Adafruit's Bus Device library:
|
27 | 28 | https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
|
| 29 | +
|
28 | 30 | * Adafruit's Register library:
|
29 | 31 | https://github.com/adafruit/Adafruit_CircuitPython_Register
|
30 | 32 | """
|
|
34 | 36 | __version__ = "0.0.0-auto.0"
|
35 | 37 | __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MPU6050.git"
|
36 | 38 |
|
| 39 | +from math import radians |
37 | 40 | from time import sleep
|
38 | 41 | from adafruit_register.i2c_struct import UnaryStruct, ROUnaryStruct
|
39 | 42 | from adafruit_register.i2c_struct_array import StructArray
|
@@ -274,9 +277,9 @@ def gyro(self):
|
274 | 277 | gyro_scale = 16.4
|
275 | 278 |
|
276 | 279 | # setup range dependant scaling
|
277 |
| - gyro_x = raw_x / gyro_scale |
278 |
| - gyro_y = raw_y / gyro_scale |
279 |
| - gyro_z = raw_z / gyro_scale |
| 280 | + gyro_x = radians(raw_x / gyro_scale) |
| 281 | + gyro_y = radians(raw_y / gyro_scale) |
| 282 | + gyro_z = radians(raw_z / gyro_scale) |
280 | 283 |
|
281 | 284 | return (gyro_x, gyro_y, gyro_z)
|
282 | 285 |
|
|
0 commit comments