Skip to content

Commit 17f9216

Browse files
committed
fix context typo
1 parent 92fe667 commit 17f9216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_fxas21002c.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ def read_raw(self):
139139
units consider using the gyroscope property!
140140
"""
141141
# Read gyro data from the sensor.
142-
with self._device:
142+
with self._device as i2c:
143143
self._BUFFER[0] = _GYRO_REGISTER_OUT_X_MSB
144-
self._device.write_then_readinto(self._BUFFER, self._BUFFER,
145-
out_end=1, stop=False)
144+
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
145+
out_end=1, stop=False)
146146
# Parse out the gyroscope data as 16-bit signed data.
147147
raw_x = struct.unpack_from('>h', self._BUFFER[0:2])[0]
148148
raw_y = struct.unpack_from('>h', self._BUFFER[2:4])[0]

0 commit comments

Comments
 (0)