2018-09-02 07:48:41 -04:00
|
|
|
"""Happy accidents or unplanned, fortunate discoveries."""
|
2018-09-02 07:17:36 -04:00
|
|
|
|
|
|
|
___name___ = "serendipity"
|
|
|
|
___license___ = "MIT"
|
2018-09-02 15:42:58 -04:00
|
|
|
___dependencies___ = ["sleep", "app", "ugfx_helper", "serendipity/world.png", "serendipity/sun.png"]
|
2018-09-02 07:17:36 -04:00
|
|
|
___categories___ = ["EMF", "Other"]
|
|
|
|
|
2018-09-02 15:42:58 -04:00
|
|
|
import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
|
2018-09-02 08:36:31 -04:00
|
|
|
from tilda import Buttons
|
2018-09-02 07:17:36 -04:00
|
|
|
|
|
|
|
# initialize screen
|
2018-09-02 15:42:58 -04:00
|
|
|
ugfx_helper.init()
|
|
|
|
ugfx.clear(ugfx.BLACK)
|
2018-09-02 07:17:36 -04:00
|
|
|
|
2018-09-02 08:36:31 -04:00
|
|
|
#ugfx.text(5, 5, "[work in progress]", ugfx.BLACK)
|
|
|
|
|
2018-09-02 15:42:58 -04:00
|
|
|
sun = ugfx.Image("serendipity/seresun.png")
|
|
|
|
sun = ugfx.Image("serendipity/world.png")
|
|
|
|
|
|
|
|
ugfx.backlight(100)
|
|
|
|
|
|
|
|
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, 90, "shared/nyan/{}.png".format(n) )
|
|
|
|
n = (n+1) % 12
|
|
|
|
sleep.sleep_ms(10)
|
|
|
|
|
|
|
|
ugfx.clear()
|
|
|
|
app.restart_to_default()
|