Skip to content
Snippets Groups Projects
Commit 9b1fd1f6 authored by schneider's avatar schneider
Browse files

fix(g-watch): Don't allow LED debugging by default

The button to turn on the LEDs gets pressed easily, making them waste
battery.
parent aaff35fe
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ DIGITS = [
DOW = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
DEBUG_LEDS = False
led_count = 11
b7 = 255 # brightness of 7-segment display 0...255
......@@ -153,7 +155,6 @@ with display.open() as disp:
leds.dim_top(2)
leds_on = 0
p_leds_on = 0
while True:
time.sleep(0.1)
......@@ -177,9 +178,8 @@ with display.open() as disp:
# ---------------------------------------- read buttons
pressed = buttons.read(buttons.BOTTOM_LEFT | buttons.BOTTOM_RIGHT)
p_leds_on = leds_on
if pressed & buttons.BOTTOM_LEFT != 0:
if DEBUG_LEDS and pressed & buttons.BOTTOM_LEFT != 0:
leds_on = 0
disp.clear()
disp.print("LEDS OFF", posx=40, posy=30, font=2)
......@@ -192,7 +192,7 @@ with display.open() as disp:
leds.update()
disp.update()
if pressed & buttons.BOTTOM_RIGHT != 0:
if DEBUG_LEDS and pressed & buttons.BOTTOM_RIGHT != 0:
leds_on = 1
disp.clear()
disp.print("LEDS ON", posx=40, posy=30, font=2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment