Skip to content

Commit b2b2245

Browse files
authored
Merge pull request #13 from fourstix/b_rw_fix
Revert write_then_readinto back to write followed by readinto
2 parents 232001e + ec687ed commit b2b2245

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@ Usage Example
154154
# For a different address use QwiicRelay(i2c, address)
155155
# relay = QwiicRelay(i2c, 0x19)
156156
157+
Upgrading
158+
=========
159+
On supported GNU/Linux systems like the Raspberry Pi, you can upgrade the driver
160+
to the latest published version.
161+
162+
To upgrade for current user:
163+
164+
.. code-block:: shell
165+
166+
pip3 install --upgrade sparkfun-circuitpython-qwiicjoystick
167+
168+
To upgrade system-wide (this may be required in some cases):
169+
170+
.. code-block:: shell
171+
172+
sudo pip3 install --upgrade sparkfun-circuitpython-qwiicjoystick
173+
157174
Contributing
158175
============
159176

sparkfun_qwiicrelay.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,11 @@ def set_i2c_address(self, new_address):
164164
def _read_command(self, command, count):
165165
# Send a command then read count number of bytes.
166166
with self._device as device:
167+
device.write(bytes([command]))
167168
result = bytearray(count)
168-
device.write_then_readinto(bytes([command]), result)
169+
device.readinto(result)
170+
# write_then_readinto function does not see to work
171+
# device.write_then_readinto(bytes([command]), result)
169172
if self._debug:
170173
print("$%02X => %s" % (command, [hex(i) for i in result]))
171174
return result

0 commit comments

Comments
 (0)