Skip to content

Commit 21c7e6c

Browse files
authored
correct checking for 3 and not have PAST view at top of hour
1 parent 79c29f8 commit 21c7e6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • CircuitPython_Simple_Wordclock

CircuitPython_Simple_Wordclock/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def writetime(the_hr, the_min):
7777
if the_min >= 54:
7878
value = value | FIVEMIN
7979
# before or after
80-
if the_min <= 30:
80+
if (the_min > 0) and (the_min <= 30):
8181
value = value | PAST
8282
else:
8383
the_hr = the_hr + 1 # for the TO case
@@ -132,7 +132,7 @@ def writetime(the_hr, the_min):
132132
# print("The time is {}:{:02}".format(t.tm_hour, t.tm_min))
133133
pixels.fill((0, 0, 0)) # blank all pixels for change
134134
the_time = writetime(hour, minute)
135-
for i in range(1, 21): # Check all 30 bits
135+
for i in range(0, 21): # Check all 30 bits
136136
if the_time & 1 << i: # If the bit is true
137137
pixels[i+1] = COLOR # set pixel on (shift up 2 for buried one)
138138
pixels.show()

0 commit comments

Comments
 (0)