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

Commit

Permalink
Merge pull request #7 from dastels/master
Browse files Browse the repository at this point in the history
Reorder mag return values from XZY order to XYZ.
  • Loading branch information
caternuson authored Oct 12, 2018
2 parents de104b3 + 6f4dbf7 commit 2a299cb
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 2a299cb

Please sign in to comment.