Skip to content

Commit 48291f8

Browse files
committed
Small fixes.
1 parent 536f9b3 commit 48291f8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
__pycache__
22
_build
33
*.pyc
4+
*.mpy

adafruit_fxos8700.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _read_u8(self, address):
110110
# Read an 8-bit unsigned value from the specified 8-bit address.
111111
with self._device:
112112
self._BUFFER[0] = address & 0xFF
113-
self._device.write(self._BUFFER, end=1)
113+
self._device.write(self._BUFFER, end=1, stop=False)
114114
self._device.readinto(self._BUFFER, end=1)
115115
return self._BUFFER[0]
116116

@@ -132,7 +132,7 @@ def read_raw_accel_mag(self):
132132
# Read 13 bytes from the sensor.
133133
with self._device:
134134
self._BUFFER[0] = _FXOS8700_REGISTER_STATUS | 0x80
135-
self._device.write(self._BUFFER, end=1)
135+
self._device.write(self._BUFFER, end=1, stop=False)
136136
self._device.readinto(self._BUFFER)
137137
# Parse out the accelerometer and magnetometer data.
138138
status = self._BUFFER[0]

examples/simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
accel_x, accel_y, accel_z = sensor.accelerometer
2323
mag_x, mag_y, mag_z = sensor.magnetometer
2424
# Print values.
25-
print('Acceleration (m/s^2): ({0:0.3f},{0:0.3f},{0:0.3f})'.format(
25+
print('Acceleration (m/s^2): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(
2626
accel_x, accel_y, accel_z))
27-
print('Magnetometer (uTesla): ({0:0.3f},{0:0.3f},{0:0.3f})'.format(
27+
print('Magnetometer (uTesla): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(
2828
mag_x, mag_y, mag_z))
2929
# Delay for a second.
3030
time.sleep(1.0)

0 commit comments

Comments
 (0)