Merge pull request #22 from emfcamp/tildatorch

Tilda Torch app for workshop
settings-app
Marek Ventur 2018-08-29 21:25:13 +01:00 committed by GitHub
commit ef6ca172df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

26
tildatorch/main.py Normal file
View File

@ -0,0 +1,26 @@
"""This app goes with the Torch Tutorial"""
___name___ = "Tilda Torch"
___license___ = "MIT"
___dependencies___ = ["sleep"]
___categories___ = ["EMF"]
import ugfx, os, time, sleep
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()