Skip to content
Merged
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
8 changes: 3 additions & 5 deletions adafruit_fxos8700.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _read_u8(self, address):
with self._device as i2c:
self._BUFFER[0] = address & 0xFF
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
out_end=1, in_end=1, stop=False)
out_end=1, in_end=1)
return self._BUFFER[0]

def _write_u8(self, address, val):
Expand All @@ -164,8 +164,7 @@ def read_raw_accel_mag(self):
with self._device as i2c:
self._BUFFER[0] = _FXOS8700_REGISTER_OUT_X_MSB
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
out_end=1, in_end=6,
stop=False)
out_end=1, in_end=6)
accel_raw_x = struct.unpack_from('>H', self._BUFFER[0:2])[0]
accel_raw_y = struct.unpack_from('>H', self._BUFFER[2:4])[0]
accel_raw_z = struct.unpack_from('>H', self._BUFFER[4:6])[0]
Expand All @@ -179,8 +178,7 @@ def read_raw_accel_mag(self):
with self._device as i2c:
self._BUFFER[0] = _FXOS8700_REGISTER_MOUT_X_MSB
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
out_end=1, in_end=6,
stop=False)
out_end=1, in_end=6)
mag_raw_x = struct.unpack_from('>h', self._BUFFER[0:2])[0]
mag_raw_y = struct.unpack_from('>h', self._BUFFER[2:4])[0]
mag_raw_z = struct.unpack_from('>h', self._BUFFER[4:6])[0]
Expand Down