Moar leds!
parent
e25928e060
commit
1948c74759
|
@ -11,6 +11,8 @@ from dialogs import *
|
||||||
import ugfx
|
import ugfx
|
||||||
import ugfx_helper
|
import ugfx_helper
|
||||||
|
|
||||||
|
from machine import Neopix
|
||||||
|
|
||||||
def show_screen(color1, color2, text, text2="", flip=False):
|
def show_screen(color1, color2, text, text2="", flip=False):
|
||||||
if flip:
|
if flip:
|
||||||
ugfx.orientation(90)
|
ugfx.orientation(90)
|
||||||
|
@ -40,9 +42,11 @@ import time
|
||||||
from tilda import Buttons
|
from tilda import Buttons
|
||||||
|
|
||||||
sim800.poweron()
|
sim800.poweron()
|
||||||
|
n = Neopix()
|
||||||
|
|
||||||
vip = False
|
vip = False
|
||||||
vip_inv = False
|
vip_inv = False
|
||||||
|
strobe = False
|
||||||
|
|
||||||
def cbButtonA(button_id):
|
def cbButtonA(button_id):
|
||||||
global vip
|
global vip
|
||||||
|
@ -122,6 +126,23 @@ def cbButton4(button_id):
|
||||||
global vip
|
global vip
|
||||||
vip = False
|
vip = False
|
||||||
ugfx.display_image(0, 0, "holland/otter.png")
|
ugfx.display_image(0, 0, "holland/otter.png")
|
||||||
|
|
||||||
|
def cbButton5(button_id):
|
||||||
|
n.display([0xFFFFFF, 0xFFFFFF])
|
||||||
|
|
||||||
|
def cbButton6(button_id):
|
||||||
|
n.display([0x000000, 0x000000])
|
||||||
|
|
||||||
|
def cbButton7(button_id):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def cbButton8(button_id):
|
||||||
|
global strobe
|
||||||
|
strobe = True
|
||||||
|
|
||||||
|
def cbButton9(button_id):
|
||||||
|
global strobe
|
||||||
|
strobe = False
|
||||||
|
|
||||||
Buttons.enable_interrupt(
|
Buttons.enable_interrupt(
|
||||||
Buttons.BTN_Call,
|
Buttons.BTN_Call,
|
||||||
|
@ -165,7 +186,38 @@ Buttons.enable_interrupt(
|
||||||
on_press=True,
|
on_press=True,
|
||||||
on_release=False);
|
on_release=False);
|
||||||
|
|
||||||
|
Buttons.enable_interrupt(
|
||||||
|
Buttons.BTN_5,
|
||||||
|
cbButton5,
|
||||||
|
on_press=True,
|
||||||
|
on_release=False);
|
||||||
|
|
||||||
|
Buttons.enable_interrupt(
|
||||||
|
Buttons.BTN_6,
|
||||||
|
cbButton6,
|
||||||
|
on_press=True,
|
||||||
|
on_release=False);
|
||||||
|
|
||||||
|
Buttons.enable_interrupt(
|
||||||
|
Buttons.BTN_7,
|
||||||
|
cbButton7,
|
||||||
|
on_press=True,
|
||||||
|
on_release=False);
|
||||||
|
|
||||||
|
Buttons.enable_interrupt(
|
||||||
|
Buttons.BTN_8,
|
||||||
|
cbButton8,
|
||||||
|
on_press=True,
|
||||||
|
on_release=False);
|
||||||
|
|
||||||
|
Buttons.enable_interrupt(
|
||||||
|
Buttons.BTN_9,
|
||||||
|
cbButton9,
|
||||||
|
on_press=True,
|
||||||
|
on_release=False);
|
||||||
|
|
||||||
vip = True
|
vip = True
|
||||||
|
aaa = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if vip_inv:
|
if vip_inv:
|
||||||
|
@ -174,4 +226,12 @@ while True:
|
||||||
vip_inv = True
|
vip_inv = True
|
||||||
if vip:
|
if vip:
|
||||||
show_vip(vip_inv)
|
show_vip(vip_inv)
|
||||||
time.sleep(0.1)
|
if strobe:
|
||||||
|
if aaa:
|
||||||
|
n.display([0xFFA500, 0xFFA500])
|
||||||
|
aaa = False
|
||||||
|
else:
|
||||||
|
n.display([0x000000, 0x000000])
|
||||||
|
aaa = True
|
||||||
|
else:
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
Loading…
Reference in New Issue