Merge remote-tracking branch 'upstream/pull/113'

sammachin-gprs
Dave Arter 2018-09-07 20:36:09 +01:00
commit 28afed2c25
3 changed files with 32 additions and 0 deletions

32
serendipity/main.py Normal file
View File

@ -0,0 +1,32 @@
"""Happy accidents or unplanned, fortunate discoveries."""
___name___ = "serendipity"
___license___ = "MIT"
___dependencies___ = ["sleep", "app", "ugfx_helper"]
___categories___ = ["EMF", "Villages"]
import ugfx_helper, os, wifi, ugfx, http, time, sleep, app
from tilda import Buttons
# initialize screen
ugfx_helper.init()
ugfx.clear(ugfx.BLACK)
img = [ugfx.Image("serendipity/sun.png"),
ugfx.Image("serendipity/world.png")]
ugfx.backlight(100)
n = 0
ugfx.display_image( 0, 0, img[n] )
while True:
if Buttons.is_pressed(Buttons.BTN_B):
break
elif Buttons.is_pressed(Buttons.BTN_A):
n = (n+1) % 2
ugfx.display_image( 0, 0, img[n] )
ugfx.clear()
app.restart_to_default()

BIN
serendipity/sun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
serendipity/world.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB