We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79c29f8 commit 21c7e6cCopy full SHA for 21c7e6c
1 file changed
CircuitPython_Simple_Wordclock/code.py
@@ -77,7 +77,7 @@ def writetime(the_hr, the_min):
77
if the_min >= 54:
78
value = value | FIVEMIN
79
# before or after
80
- if the_min <= 30:
+ if (the_min > 0) and (the_min <= 30):
81
value = value | PAST
82
else:
83
the_hr = the_hr + 1 # for the TO case
@@ -132,7 +132,7 @@ def writetime(the_hr, the_min):
132
# print("The time is {}:{:02}".format(t.tm_hour, t.tm_min))
133
pixels.fill((0, 0, 0)) # blank all pixels for change
134
the_time = writetime(hour, minute)
135
- for i in range(1, 21): # Check all 30 bits
+ for i in range(0, 21): # Check all 30 bits
136
if the_time & 1 << i: # If the bit is true
137
pixels[i+1] = COLOR # set pixel on (shift up 2 for buried one)
138
pixels.show()
0 commit comments