Skip to content

Commit 42d6c1f

Browse files
authored
Merge pull request #2598 from adafruit/talking_adabot
fixing 12PM bug
2 parents f68edba + d3ac7bd commit 42d6c1f

File tree

1 file changed

+5
-3
lines changed
  • CircuitPython_Talking_Adabot_Clock

1 file changed

+5
-3
lines changed

CircuitPython_Talking_Adabot_Clock/code.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ def prep_clock(hour_num, minute_num):
8888
# queues "the time is.."
8989
open_audio(bookend_sounds, 1)
9090
# convert 24 hour time from RTC to 12 hour
91-
if hour_num > 12:
92-
hour_num = hour_num - 12
93-
# set PM
91+
if hour_num >= 12:
92+
# convert 24 hour to 12 hour
93+
if hour_num > 12:
94+
hour_num = hour_num - 12
95+
# set to PM
9496
ampm_num = 3
9597
# otherwise its the morning
9698
else:

0 commit comments

Comments
 (0)