serendipity!
parent
ea236d4c7b
commit
df307c85f1
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
___name___ = "serendipity"
|
___name___ = "serendipity"
|
||||||
___license___ = "MIT"
|
___license___ = "MIT"
|
||||||
___dependencies___ = ["sleep", "app", "ugfx_helper", "serendipity/world.png", "serendipity/sun.png"]
|
___dependencies___ = ["sleep", "app", "ugfx_helper"]
|
||||||
___categories___ = ["EMF", "Other"]
|
___categories___ = ["EMF", "Other"]
|
||||||
|
|
||||||
import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
|
import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
|
||||||
|
@ -12,19 +12,21 @@ from tilda import Buttons
|
||||||
ugfx_helper.init()
|
ugfx_helper.init()
|
||||||
ugfx.clear(ugfx.BLACK)
|
ugfx.clear(ugfx.BLACK)
|
||||||
|
|
||||||
#ugfx.text(5, 5, "[work in progress]", ugfx.BLACK)
|
img = [ugfx.Image("serendipity/sun.png"),
|
||||||
|
ugfx.Image("serendipity/world.png")]
|
||||||
sun = ugfx.Image("serendipity/seresun.png")
|
|
||||||
sun = ugfx.Image("serendipity/world.png")
|
|
||||||
|
|
||||||
ugfx.backlight(100)
|
ugfx.backlight(100)
|
||||||
|
|
||||||
n = 0
|
n = 0
|
||||||
while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)):
|
ugfx.display_image( 0, 0, img[n] )
|
||||||
|
|
||||||
|
while True:
|
||||||
|
|
||||||
ugfx.display_image( 0, 90, "shared/nyan/{}.png".format(n) )
|
if Buttons.is_pressed(Buttons.BTN_B):
|
||||||
n = (n+1) % 12
|
break
|
||||||
sleep.sleep_ms(10)
|
elif Buttons.is_pressed(Buttons.BTN_A):
|
||||||
|
n = (n+1) % 2
|
||||||
|
ugfx.display_image( 0, 0, img[n] )
|
||||||
|
|
||||||
ugfx.clear()
|
ugfx.clear()
|
||||||
app.restart_to_default()
|
app.restart_to_default()
|
Binary file not shown.
Before Width: | Height: | Size: 172 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Loading…
Reference in New Issue