8000 Update adafruit_tlv493d.py by BrianPugh · Pull Request #16 · adafruit/Adafruit_CircuitPython_TLV493D · GitHub
[go: up one dir, main page]

Skip to content

Update adafruit_tlv493d.py #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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