10000 It is magnetic not orientation · tuupola/micropython-mpu9250@bdb758e · GitHub
[go: up one dir, main page]

Skip to content

Commit bdb758e

Browse files
committed
It is magnetic not orientation
See adafruit/circuitpython#612
1 parent 678543f commit bdb758e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ak8963.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
_MODE_SELF_TEST = 0x08
3535
_MODE_FUSE_ROM_ACCESS = 0x0f
3636

37+
_SO_14BIT = 0.6 # μT per digit when 14bit mode
38+
_SO_16BIT = 0.15 # μT/LSB typ.16- bit)
39+
3740
class AK8963:
3841
"""Class which provides interface to AK8963 magnetometer."""
3942
def __init__(self, i2c, address=0x0c):
@@ -46,9 +49,9 @@ def __init__(self, i2c, address=0x0c):
4649
self._register_char(_CNTL1, _MODE_CONTINOUS_MEASURE_2)
4750

4851
@property
49-
def orientation(self):
52+
def magnetic(self):
5053
"""
51-
x, y, z degrees as floats
54+
X, Y, Z axis micro-Tesla (uT) as floats.
5255
"""
5356
# so = self._accel_so
5457
# sf = self._accel_sf

mpu9250.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def gyro(self):
5757
return self.mpu6050.gyro
5858

5959
@property
60-
def orientation(self):
60+
def magnetic(self):
6161
"""
62-
X, Y, Z axis degrees as floats.
62+
X, Y, Z axis micro-Tesla (uT) as floats.
6363
"""
64-
return self.ak8963.orientation
64+
return self.ak8963.magnetic
6565

6666
@property
6767
def whoami(self):

0 commit comments

Comments
 (0)
0