feat: menu demo
This commit is contained in:
10
encoder.py
Normal file
10
encoder.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from machine import Pin
|
||||
|
||||
|
||||
class Encoder:
|
||||
def __init__(self, pin_a: Pin, pin_b: Pin, on_left, on_right) -> None:
|
||||
self.pin_a = pin_a
|
||||
self.pin_b = pin_b
|
||||
pin_a.irq(trigger=Pin.IRQ_RISING, handler=on_left)
|
||||
pin_b.irq(trigger=Pin.IRQ_RISING, handler=on_right)
|
||||
pass
|
||||
Reference in New Issue
Block a user