We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92fe667 commit 17f9216Copy full SHA for 17f9216
adafruit_fxas21002c.py
@@ -139,10 +139,10 @@ def read_raw(self):
139
units consider using the gyroscope property!
140
"""
141
# Read gyro data from the sensor.
142
- with self._device:
+ with self._device as i2c:
143
self._BUFFER[0] = _GYRO_REGISTER_OUT_X_MSB
144
- self._device.write_then_readinto(self._BUFFER, self._BUFFER,
145
- out_end=1, stop=False)
+ i2c.write_then_readinto(self._BUFFER, self._BUFFER,
+ out_end=1, stop=False)
146
# Parse out the gyroscope data as 16-bit signed data.
147
raw_x = struct.unpack_from('>h', self._BUFFER[0:2])[0]
148
raw_y = struct.unpack_from('>h', self._BUFFER[2:4])[0]
0 commit comments