a
This commit is contained in:
3
init.py
3
init.py
@@ -28,7 +28,7 @@ class AlarmClock:
|
||||
def __init__(self, pins: dict = {}):
|
||||
self.ledGpio = GPIO(pins.get("led", 5), GPIO.OUT)
|
||||
self.buttonGpio = GPIO(pins.get("button", 6), GPIO.IN)
|
||||
self.relayGpio = GPIO(pins.get("relay", 16), GPIO.OUT)
|
||||
self.relayGpio = GPIO(pins.get("relay", 17), GPIO.OUT)
|
||||
self.lcd = JHD1802()
|
||||
self.setLcdText("AlarmClock Init")
|
||||
|
||||
@@ -49,6 +49,7 @@ class AlarmClock:
|
||||
print(f"Button '{button}' pressed state: {state}")
|
||||
if button == "button":
|
||||
self.lastButtonPressTime = time()
|
||||
self.relayGpio.write(GPIO.HIGH if state else GPIO.LOW)
|
||||
self.setLcdText(self.lastButtonPressTime.__str__())
|
||||
|
||||
def setLcdText(self, text: str):
|
||||
|
||||
Reference in New Issue
Block a user