add keypad scanner for shift registers

This commit is contained in:
xs5871 authored and Kyle Brown committed 2022-04-12 08:29:23 -07:00
1 parent b3ec37e274
commit d2e87b3e70
2 files changed
+51

No files matched your search

+26
View File
@@ -88,3 +88,29 @@ class KeysScanner(KeypadScanner):
max_events=max_events,
)
super().__init__()
class ShiftRegisterKeys(KeypadScanner):
def __init__(
self,
*,
clock,
data,
latch,
value_to_latch=True,
key_count,
value_when_pressed=False,
interval=0.02,
max_events=64,
):
self.keypad = keypad.ShiftRegisterKeys(
clock=clock,
data=data,
latch=latch,
value_to_latch=value_to_latch,
key_count=key_count,
value_when_pressed=value_when_pressed,
interval=interval,
max_events=max_events,
)
super().__init__()