local images

sammachin-gprs
Heinrich Mellmann 2018-09-02 20:42:58 +01:00
parent 85365a8a1d
commit ea236d4c7b
1 changed files with 16 additions and 18 deletions

View File

@ -2,31 +2,29 @@
___name___ = "serendipity" ___name___ = "serendipity"
___license___ = "MIT" ___license___ = "MIT"
___dependencies___ = ["sleep", "app", "ugfx_helper"] ___dependencies___ = ["sleep", "app", "ugfx_helper", "serendipity/world.png", "serendipity/sun.png"]
___categories___ = ["EMF", "Other"] ___categories___ = ["EMF", "Other"]
import ugfx_helper, ugfx, os, time, sleep, app import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
from tilda import Buttons from tilda import Buttons
# initialize screen # initialize screen
ugfx.init() ugfx_helper.init()
ugfx.clear() ugfx.clear(ugfx.BLACK)
#ugfx.text(5, 5, "[work in progress]", ugfx.BLACK) #ugfx.text(5, 5, "[work in progress]", ugfx.BLACK)
def show_screen(): sun = ugfx.Image("serendipity/seresun.png")
ugfx.display_image( 0, 0, "serendipity/main.png" ) sun = ugfx.Image("serendipity/world.png")
ugfx.backlight(100)
show_screen()
while True:
sleep.wfi()
if Buttons.is_pressed( Buttons.BTN_Menu ) or \ n = 0
Buttons.is_pressed( Buttons.BTN_B ) or \ while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)):
Buttons.is_pressed( Buttons.JOY_Center):
break ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) )
n = (n+1) % 12
ugfx.clear() sleep.sleep_ms(10)
ugfx.clear()
app.restart_to_default()