diff --git a/CircuitPython_Simple_Wordclock/code.py b/CircuitPython_Simple_Wordclock/code.py index 8c568c892..cf0dd4b1a 100644 --- a/CircuitPython_Simple_Wordclock/code.py +++ b/CircuitPython_Simple_Wordclock/code.py @@ -89,6 +89,9 @@ def writetime(the_hr, the_min): the_hr = the_hr + 1 # for the TO case value = value | TO # set hour + if the_hr == 24: # special case for Midnight + value = value | MIDNIGHT + return value if the_hr > 12: the_hr = the_hr - 12 # Convert 24 hour format to 12 hour if the_hr == 1: @@ -113,8 +116,6 @@ def writetime(the_hr, the_min): value = value | TEN if the_hr == 11: value = value | ELEVEN - if the_hr == 0: - value = value | MIDNIGHT if the_hr == 12: value = value | NOON return value