Skip to content

Commit 64191a9

Browse files
committed
Fix for new I2CDevice API.
1 parent 9b9b26a commit 64191a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_mpr121/mpr121.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, i2c, address=MPR121_I2CADDR_DEFAULT):
5656
def _write_register_byte(self, register, value):
5757
# Write a byte value to the specifier register address.
5858
with self._i2c:
59-
self._i2c.writeto(bytes([register, value]))
59+
self._i2c.write(bytes([register, value]))
6060

6161
def _read_register_bytes(self, register, result, length=None):
6262
# Read the specified register address and fill the specified result byte
@@ -65,8 +65,8 @@ def _read_register_bytes(self, register, result, length=None):
6565
if length is None:
6666
length = len(result)
6767
with self._i2c:
68-
self._i2c.writeto(bytes([register]), stop=False)
69-
self._i2c.readfrom_into(result, start=0, end=length)
68+
self._i2c.write(bytes([register]), stop=False)
69+
self._i2c.read_into(result, start=0, end=length)
7070

7171
def reset(self):
7272
"""Reset the MPR121 into a default state ready to detect touch inputs.

0 commit comments

Comments
 (0)