Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code.py #775

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CircuitPython_Simple_Wordclock/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down