Update LCD display to show seconds and adjust formatting
This commit is contained in:
5
init.py
5
init.py
@@ -55,8 +55,9 @@ class AlarmClock:
|
||||
if (self.configMode == "normal"):
|
||||
currentMinute = int((currentTime / 60) % 60)
|
||||
currentHour = int((currentTime / 3600) % 24)
|
||||
currrentSecond = int(currentTime % 60)
|
||||
|
||||
self.setLcdText(f"Time {currentHour:02d}:{currentMinute:02d} \nAlarm {self.alarmHour:02d}:{self.alarmMinute:02d}")
|
||||
self.setLcdText(f"Time {currentHour:02d}:{currentMinute:02d}:{currrentSecond:02d}\nAlarm {self.alarmHour:02d}:{self.alarmMinute:02d}")
|
||||
|
||||
# Only process button state change if debounce delay has passed
|
||||
if currentButtonState != self.lastKnownButtonState:
|
||||
@@ -127,7 +128,7 @@ class AlarmClock:
|
||||
for i, row in enumerate(rows):
|
||||
if i == 0:
|
||||
self.lcd.setCursor(0, 0)
|
||||
self.lcd.write(f"{(" "+row):<16}")
|
||||
self.lcd.write(f"{(" "+row):<17}")
|
||||
elif i == 1:
|
||||
self.lcd.setCursor(1, 0)
|
||||
self.lcd.write(row)
|
||||
|
||||
Reference in New Issue
Block a user