2018-08-29 12:57:07 -04:00
|
|
|
"""This app goes with the Torch Tutorial"""
|
|
|
|
|
|
|
|
___name___ = "Tilda Torch"
|
|
|
|
___license___ = "MIT"
|
2018-08-31 11:20:30 -04:00
|
|
|
___dependencies___ = ["sleep", "app"]
|
2018-08-29 12:57:07 -04:00
|
|
|
___categories___ = ["EMF"]
|
|
|
|
|
2018-08-31 11:20:30 -04:00
|
|
|
import ugfx, os, time, sleep, app
|
2018-08-29 12:57:07 -04:00
|
|
|
from tilda import Buttons
|
|
|
|
from machine import Pin
|
|
|
|
|
|
|
|
torch = Pin(Pin.GPIO_FET)
|
|
|
|
|
|
|
|
ugfx.init()
|
|
|
|
Pin(Pin.PWM_LCD_BLIGHT).on()
|
|
|
|
ugfx.clear()
|
|
|
|
|
|
|
|
ugfx.text(5, 5, "TORRRRRRCH!!!!!", ugfx.BLACK)
|
|
|
|
torch.on()
|
|
|
|
|
|
|
|
while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)):
|
|
|
|
sleep.wfi()
|
|
|
|
|
|
|
|
torch.off()
|
|
|
|
|
|
|
|
ugfx.clear()
|
2018-08-31 11:20:30 -04:00
|
|
|
|
|
|
|
app.restart_to_default()
|