dont-delete-test-download-branch
Marek Ventur 2018-07-30 21:30:52 +01:00
parent 71e1ec63ff
commit 401e29975a
5 changed files with 28 additions and 1 deletions

BIN
badge_store/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -6,4 +6,20 @@ ___categories___ = ["System"]
___launchable___ = False
___bootstrapped___ = True
import ugfx
ugfx.clear()
apps = range(1, 10)
cols = 4
for i, p in enumerate(apps):
logical_x = i % cols
logical_y = i // cols
x = logical_x * width
print("launcher")

View File

@ -15,6 +15,13 @@ CONFIG = {
"BTN_B": pyb.Pin.PULL_UP
}
ROTATION_MAP = {
"JOY_UP": "JOY_LEFT",
"JOY_LEFT": "JOY_DOWN",
"JOY_DOWN": "JOY_RIGHT",
"JOY_RIGHT": "JOY_UP",
}
_tilda_pins = {}
_tilda_interrupts = {}
_tilda_bounce = {}
@ -31,6 +38,11 @@ def init(buttons = CONFIG.keys()):
_tilda_pins[button] = pyb.Pin(button, pyb.Pin.IN)
_tilda_pins[button].init(pyb.Pin.IN, CONFIG[button])
def rotate(button):
"""remaps names of buttons to rotated values"""
return ROTATION_MAP[button]
def is_pressed(button):
pin = _get_pin(button)
if pin.pull() == pyb.Pin.PULL_DOWN:

View File

@ -12,7 +12,6 @@ In particular, they *should*:
They also *may*:
* Display a name, returned by "homescreen.name()"
* Display network strength "homescreen.mobile_strength()" (0-1, might return "None" if no SIM card found)
* Display network strength "homescreen.wifi_strength()" (0-1, might return "None" if not connected)
* Display remaining battery "homescreen.battery()" (0-1)
"""