|
80 | 80 | # pylint: enable=bad-whitespace
|
81 | 81 |
|
82 | 82 | class MPR121_Channel():
|
| 83 | + # pylint: disable=protected-access |
83 | 84 | """Helper class to represent a touch channel on the MPR121. Not meant to
|
84 | 85 | be used directly."""
|
85 | 86 | def __init__(self, mpr121, channel):
|
@@ -107,7 +108,7 @@ def thresholds(self):
|
107 | 108 | def thresholds(self, value):
|
108 | 109 | touch, release = value
|
109 | 110 | self._mpr121._write_register_byte(MPR121_TOUCHTH_0 + 2*self._channel, touch)
|
110 |
| - self._mpr121._write_register_byte(MPR121_RELEASETH_0 + 2*self._channel, release) |
| 111 | + self._mpr121._write_register_byte(MPR121_RELEASETH_0 + 2*self._channel, release) |
111 | 112 |
|
112 | 113 | class MPR121:
|
113 | 114 | """Driver for the MPR121 capacitive touch breakout board."""
|
@@ -136,13 +137,13 @@ def thresholds(self):
|
136 | 137 | """The touch / release threholds for all channels."""
|
137 | 138 | buf = bytearray(24)
|
138 | 139 | self._read_register_bytes(MPR121_TOUCHTH_0, buf, 24)
|
139 |
| - return tuple( [ (buf[2*i], buf[2*i+1]) for i in range(12) ] ) |
| 140 | + return tuple([(buf[2*i], buf[2*i+1]) for i in range(12)]) |
140 | 141 |
|
141 | 142 | @thresholds.setter
|
142 | 143 | def thresholds(self, value):
|
143 | 144 | touch, release = value
|
144 | 145 | self.set_thresholds(touch, release)
|
145 |
| - |
| 146 | + |
146 | 147 | def _write_register_byte(self, register, value):
|
147 | 148 | # Write a byte value to the specifier register address.
|
148 | 149 | # MPR121 must be put in Stop Mode to write to most registers
|
|
0 commit comments