This commit is contained in:
Lukas Schulz 2020-12-20 00:15:37 +01:00
parent af3040ce26
commit d09b7cdcb3

10
main.py
View file

@ -29,6 +29,7 @@ options.gpio_slowdown = 4
options.brightness = 50 options.brightness = 50
screen = RGBMatrix(options = options) screen = RGBMatrix(options = options)
changed = True
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri) token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
@ -76,8 +77,9 @@ def main():
def updateImage(): def updateImage():
this.canvas = Image.new('RGB', (192, 128), color = 'red') global canvas = Image.new('RGB', (192, 128), color = 'red')
this.canvas = canvas.paste(get_track(), (0,0)) global canvas = canvas.paste(get_track(), (0,0))
global changed = True
@ -86,7 +88,9 @@ if __name__ == "__main__":
print('text') print('text')
while True: while True:
showImage(canvas) if (changed):
showImage(canvas)
global changed = False