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
...@@ -27,6 +27,8 @@ DIGITS = [ ...@@ -27,6 +27,8 @@ DIGITS = [
DOW = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"] DOW = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
DEBUG_LEDS = False
led_count = 11 led_count = 11
b7 = 255 # brightness of 7-segment display 0...255 b7 = 255 # brightness of 7-segment display 0...255
...@@ -153,7 +155,6 @@ with display.open() as disp: ...@@ -153,7 +155,6 @@ with display.open() as disp:
leds.dim_top(2) leds.dim_top(2)
leds_on = 0 leds_on = 0
p_leds_on = 0
while True: while True:
time.sleep(0.1) time.sleep(0.1)
...@@ -177,9 +178,8 @@ with display.open() as disp: ...@@ -177,9 +178,8 @@ with display.open() as disp:
# ---------------------------------------- read buttons # ---------------------------------------- read buttons
pressed = buttons.read(buttons.BOTTOM_LEFT | buttons.BOTTOM_RIGHT) 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 leds_on = 0
disp.clear() disp.clear()
disp.print("LEDS OFF", posx=40, posy=30, font=2) disp.print("LEDS OFF", posx=40, posy=30, font=2)
...@@ -192,7 +192,7 @@ with display.open() as disp: ...@@ -192,7 +192,7 @@ with display.open() as disp:
leds.update() leds.update()
disp.update() disp.update()
if pressed & buttons.BOTTOM_RIGHT != 0: if DEBUG_LEDS and pressed & buttons.BOTTOM_RIGHT != 0:
leds_on = 1 leds_on = 1
disp.clear() disp.clear()
disp.print("LEDS ON", posx=40, posy=30, font=2) disp.print("LEDS ON", posx=40, posy=30, font=2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment