Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Reorder mag return values from XZY order to XYZ.
Browse files Browse the repository at this point in the history
  • Loading branch information
dastels committed Oct 11, 2018
1 parent de104b3 commit 6f4dbf7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adafruit_lsm303.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def raw_magnetic(self):
"""
self._read_bytes(self._mag_device, _REG_MAG_OUT_X_H_M, 6, self._BUFFER)
raw_values = struct.unpack_from('>hhh', self._BUFFER[0:6])
return tuple([n >> 4 for n in raw_values])
values = tuple([n >> 4 for n in raw_values])
return (values[0], values[2], values[1])

@property
def magnetic(self):
Expand Down

0 comments on commit 6f4dbf7

Please sign in to comment.