Skip to content

Commit d3ac7bd

Browse files
committed
fixing 12PM bug
found bug where it thought 12PM was 12AM
1 parent e6d6794 commit d3ac7bd

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)