Skip to content

Commit

Permalink
Merge pull request #16 from BrianPugh/patch-1
Browse files Browse the repository at this point in the history
Update adafruit_tlv493d.py
  • Loading branch information
tekktrik committed Sep 8, 2022
2 parents ef85840 + 42f70d7 commit 0cf061d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Usage Example
tlv = adafruit_tlv493d.TLV493D(i2c)
while True:
print("X: %s, Y:%s, Z:%s mT"%tlv.magnetic)
print("X: %s, Y:%s, Z:%s uT"%tlv.magnetic)
time.sleep(1)
Documentation
Expand Down
2 changes: 1 addition & 1 deletion adafruit_tlv493d.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ def magnetic(self) -> Tuple[float, float, float]:
def _unpack_and_scale(top: int, bottom: int) -> float:
binval = struct.unpack_from(">h", bytearray([top, bottom]))[0]
binval = binval >> 4
return binval * 0.098
return binval * 98.0
2 changes: 1 addition & 1 deletion examples/tlv493d_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
tlv = adafruit_tlv493d.TLV493D(i2c)

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

0 comments on commit 0cf061d

Please sign in to comment.