Skip to content

Commit 589abd5

Browse files
Tinyu-Zhaolbuque
authored andcommitted
lib/unit: Fixe 8EncoderUnit incorrect reading opposite btn status.
Signed-off-by: tinyu <[email protected]>
1 parent 75fde34 commit 589abd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

m5stack/libs/unit/encoder8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def get_button_status(self, channel: int = 1) -> bool:
181181
channel >= self._ENCODER_BUTTON_START_REG and channel <= self._ENCODER_BUTTON_END_REG
182182
):
183183
channel = self._ENCODER_BUTTON_START_REG
184-
return bool(self.read_reg_data(channel, 1)[0])
184+
return self.read_reg_data(channel, 1)[0] == 0
185185

186186
def get_switch_status(self) -> bool:
187187
"""

0 commit comments

Comments
 (0)