Update kmk/modules/encoder.py
Co-authored-by: Tonasz <27835465+Tonasz@users.noreply.github.com>
This commit is contained in:
parent
7f5ea97bba
commit
a34272dd18
@ -102,7 +102,9 @@ class GPIOEncoder(BaseEncoder):
|
||||
|
||||
self.pin_a = EncoderPin(pin_a)
|
||||
self.pin_b = EncoderPin(pin_b)
|
||||
self.pin_button = EncoderPin(pin_button, button_type=True)
|
||||
self.pin_button = (
|
||||
EncoderPin(pin_button, button_type=True) if pin_button is not None else None
|
||||
)
|
||||
|
||||
self._state = (self.pin_a.get_value(), self.pin_b.get_value())
|
||||
def button_event(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user