feat: menu demo

This commit is contained in:
xGlc
2026-05-10 13:03:24 +02:00
parent f852c1a2b5
commit 2bbe5ae0e8
4 changed files with 158 additions and 55 deletions

10
encoder.py Normal file
View 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