Merge pull request #108 from mellmann/nyan

nyan cat animation
sammachin-gprs
Dave Arter 2018-09-09 10:28:04 +01:00 committed by GitHub
commit f5e61c6b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 0 deletions

39
nyan/main.py Normal file
View File

@ -0,0 +1,39 @@
"""Nyan Cat Animation! Rotate the screen with 'A'."""
___name___ = "nyan"
___license___ = "MIT"
___dependencies___ = ["sleep", "app", "ugfx_helper",
"shared/nyan/0.png",
"shared/nyan/1.png",
"shared/nyan/2.png",
"shared/nyan/3.png",
"shared/nyan/4.png",
"shared/nyan/5.png"]
___categories___ = ["Homescreens", "Other"]
import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
from tilda import Buttons
# initialize screen
ugfx_helper.init()
ugfx.clear(ugfx.BLACK)
ugfx.backlight(100)
n = 0
r = 270
while True:
ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) )
n = (n+1) % 6
sleep.sleep_ms(10)
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()

BIN
shared/nyan/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

BIN
shared/nyan/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
shared/nyan/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

BIN
shared/nyan/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
shared/nyan/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

BIN
shared/nyan/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B