From 9e7768f9f580d76a219aa640e466b2a97db4a8cf Mon Sep 17 00:00:00 2001 From: Heinrich Mellmann Date: Sun, 2 Sep 2018 22:01:52 +0100 Subject: [PATCH] rotate the acreen with the A button --- nyan/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nyan/main.py b/nyan/main.py index 34cfde5..bef5e85 100644 --- a/nyan/main.py +++ b/nyan/main.py @@ -1,4 +1,4 @@ -"""Nyan Cat Animation!""" +"""Nyan Cat Animation! Rotate the screen with 'A'.""" ___name___ = "nyan" ___license___ = "MIT" @@ -28,6 +28,7 @@ ugfx.clear(ugfx.BLACK) ugfx.backlight(100) n = 0 +r = 90 while True: ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) ) n = (n+2) % 12 @@ -35,6 +36,10 @@ while True: if Buttons.is_pressed(Buttons.BTN_B): break + elif Buttons.is_pressed(Buttons.BTN_A): + r = (r + 180) % 360 + ugfx.clear(ugfx.BLACK) + ugfx.orientation(r) ugfx.clear() app.restart_to_default() \ No newline at end of file