import time
from BathroomStallController import BathroomStallController
from machine import Pin
# Initialize the controllers for both stalls
stall1_controller = BathroomStallController(1)
stall2_controller = BathroomStallController(2)
def check_button(button, controller):
if button.isPressed():
controller.button_pressed()
time.sleep(0.2) # Debounce delay
while True:
check_button(stall1_controller.doorButton, stall1_controller)
check_button(stall2_controller.doorButton, stall2_controller)
time.sleep(0.05) # Reduce CPU load