include weekday in /start/clock
This commit is contained in:
parent
39cd98823a
commit
a82745d6a0
1 changed files with 5 additions and 4 deletions
|
|
@ -14,16 +14,17 @@ def start(stop_event, text="Hello World!"):
|
|||
draw = ImageDraw.Draw(image_buffer)
|
||||
while not stop_event.is_set():
|
||||
# All to black
|
||||
draw.rectangle( ((0,0),(lib.display.matrix.width-1,lib.display.matrix.height-1)), fill=(0,50,0) )
|
||||
#draw.rectangle( ((0,0),(lib.display.matrix.width-1,lib.display.matrix.height-1)), fill=(255,255,255) )
|
||||
draw.rectangle( ((0,0),(lib.display.matrix.width-1,lib.display.matrix.height-1)), fill=(0,0,0) )
|
||||
|
||||
# Current time
|
||||
now = datetime.datetime.now()
|
||||
#now_string = now.strftime('%d. %B %Y – %H:%M:%S')
|
||||
# Date into top left
|
||||
draw.text((0, 0), now.strftime('%d. %B %Y'), fill=(255, 255, 0), font=lib.display.matrix.font)
|
||||
draw.text((10, 0), now.strftime('%d. %B %Y'), fill=(255, 255, 0), font=lib.display.matrix.font)
|
||||
# Time into middle
|
||||
draw.text((20, 20), now.strftime('%H:%M:%S'), fill=(0, 255, 255), font=lib.display.matrix.large_font)
|
||||
draw.text((100, 20), now.strftime('%H:%M:%S'), fill=(0, 255, 255), font=lib.display.matrix.large_font)
|
||||
# Weekday
|
||||
draw.text((10, 33), now.strftime('%A'), fill=(255, 0, 255), font=lib.display.matrix.font)
|
||||
|
||||
float_seconds = now.second + now.microsecond/10**6
|
||||
length = 64*4/60.0*float_seconds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue