Skip to content

Commit 42f70d7

Browse files
committed
fix reported milliteslas to microtesla
1 parent ba6b6fe commit 42f70d7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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
tlv = adafruit_tlv493d.TLV493D(i2c)
7070
7171
while True:
72-
print("X: %s, Y:%s, Z:%s mT"%tlv.magnetic)
72+
print("X: %s, Y:%s, Z:%s uT"%tlv.magnetic)
7373
time.sleep(1)
7474
7575
Documentation

adafruit_tlv493d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _set_write_key(self, key: str, value: int) -> None:
158158
@property
159159
def magnetic(self) -> Tuple[float, float, float]:
160160
"""The processed magnetometer sensor values.
161-
A 3-tuple of X, Y, Z axis values in milliteslas that are signed floats.
161+
A 3-tuple of X, Y, Z axis values in microteslas that are signed floats.
162162
"""
163163
self._read_i2c() # update read registers
164164
x_top = self._get_read_key("BX1")
@@ -178,4 +178,4 @@ def magnetic(self) -> Tuple[float, float, float]:
178178
def _unpack_and_scale(top: int, bottom: int) -> float:
179179
binval = struct.unpack_from(">h", bytearray([top, bottom]))[0]
180180
binval = binval >> 4
181-
return binval * 0.098
181+
return binval * 98.0

examples/tlv493d_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
tlv = adafruit_tlv493d.TLV493D(i2c)
1010

1111
while True:
12-
print("X: %s, Y: %s, Z: %s mT" % tlv.magnetic)
12+
print("X: %s, Y: %s, Z: %s uT" % tlv.magnetic)
1313
time.sleep(1)

0 commit comments

Comments
 (0)