[refactor] Move screen class to separate file.

This commit is contained in:
2025-04-05 20:55:30 +02:00
parent d5cf59b739
commit 0b5b58bb84
7 changed files with 82 additions and 106 deletions
+14
View File
@@ -0,0 +1,14 @@
from machine import Pin
# Joystick class to handle joystick input
class Joystick:
def __init__(self):
# Map buttons
self.button_a = Pin(15, Pin.IN, Pin.PULL_UP)
self.button_b = Pin(17, Pin.IN, Pin.PULL_UP)
# Map joystick
self.joy_up = Pin(2, Pin.IN, Pin.PULL_UP)
self.joy_down = Pin(18, Pin.IN, Pin.PULL_UP)
self.joy_left = Pin(16, Pin.IN, Pin.PULL_UP)
self.joy_right = Pin(20, Pin.IN, Pin.PULL_UP)
self.joy_click = Pin(3, Pin.IN, Pin.PULL_UP)