aaa
This commit is contained in:
8
init.py
8
init.py
@@ -27,7 +27,7 @@ class AlarmClock:
|
|||||||
lastButtonPressTime: float = 0.0
|
lastButtonPressTime: float = 0.0
|
||||||
lastButtonStateChangeTime: float = 0.0
|
lastButtonStateChangeTime: float = 0.0
|
||||||
debounceDelay: float = 0.05 # 50ms debounce delay
|
debounceDelay: float = 0.05 # 50ms debounce delay
|
||||||
longPressThreshold: float = 2.0 # 2 seconds for long press
|
longPressThreshold: float = 1.0 # 1 second for long press
|
||||||
buttonPressStartTime: float = 0.0
|
buttonPressStartTime: float = 0.0
|
||||||
configMode: str = "normal" # modes: normal, set_hour, set_minute
|
configMode: str = "normal" # modes: normal, set_hour, set_minute
|
||||||
alarmHour: int = 7
|
alarmHour: int = 7
|
||||||
@@ -70,7 +70,11 @@ class AlarmClock:
|
|||||||
self.lcd.clear()
|
self.lcd.clear()
|
||||||
# write the time on spanning both rows of the LCD
|
# write the time on spanning both rows of the LCD
|
||||||
timeString = f"{hours:02}:{minutes:02}"
|
timeString = f"{hours:02}:{minutes:02}"
|
||||||
self.lcd.write(timeString)
|
self.setLcdText(timeString)
|
||||||
|
|
||||||
|
def generateDualLineTimeString(self, hours: int, minutes: int) -> str:
|
||||||
|
# generate custom characters to display time in dual line format
|
||||||
|
|
||||||
|
|
||||||
def onButtonPress(self, button: str, state: bool):
|
def onButtonPress(self, button: str, state: bool):
|
||||||
print(f"Button '{button}' pressed state: {state}")
|
print(f"Button '{button}' pressed state: {state}")
|
||||||
|
|||||||
Reference in New Issue
Block a user