rotate the acreen with the A button
parent
bd9214ca4f
commit
9e7768f9f5
|
@ -1,4 +1,4 @@
|
||||||
"""Nyan Cat Animation!"""
|
"""Nyan Cat Animation! Rotate the screen with 'A'."""
|
||||||
|
|
||||||
___name___ = "nyan"
|
___name___ = "nyan"
|
||||||
___license___ = "MIT"
|
___license___ = "MIT"
|
||||||
|
@ -28,6 +28,7 @@ ugfx.clear(ugfx.BLACK)
|
||||||
ugfx.backlight(100)
|
ugfx.backlight(100)
|
||||||
|
|
||||||
n = 0
|
n = 0
|
||||||
|
r = 90
|
||||||
while True:
|
while True:
|
||||||
ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) )
|
ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) )
|
||||||
n = (n+2) % 12
|
n = (n+2) % 12
|
||||||
|
@ -35,6 +36,10 @@ while True:
|
||||||
|
|
||||||
if Buttons.is_pressed(Buttons.BTN_B):
|
if Buttons.is_pressed(Buttons.BTN_B):
|
||||||
break
|
break
|
||||||
|
elif Buttons.is_pressed(Buttons.BTN_A):
|
||||||
|
r = (r + 180) % 360
|
||||||
|
ugfx.clear(ugfx.BLACK)
|
||||||
|
ugfx.orientation(r)
|
||||||
|
|
||||||
ugfx.clear()
|
ugfx.clear()
|
||||||
app.restart_to_default()
|
app.restart_to_default()
|
Loading…
Reference in New Issue