From 515dd258e1654e467327c5867414f42d55b3fb22 Mon Sep 17 00:00:00 2001 From: John Edgar Park Date: Tue, 9 Oct 2018 13:29:48 -0700 Subject: [PATCH] Update main.py fixed for pylint, now passes locally, please re-PR @djecken --- NeoTrellis_Color_Game/main.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/NeoTrellis_Color_Game/main.py b/NeoTrellis_Color_Game/main.py index 3df56a6b..5e0665fd 100755 --- a/NeoTrellis_Color_Game/main.py +++ b/NeoTrellis_Color_Game/main.py @@ -1,7 +1,8 @@ -import time, random +import time +import random import board -import digitalio from board import SCL, SDA +import digitalio import busio from adafruit_neotrellis.neotrellis import NeoTrellis @@ -39,13 +40,13 @@ def blink(event): if event.edge == NeoTrellis.EDGE_RISING: if button.value: trellis.pixels[event.number] = WHITE - else: - for i in range(16): - trellis.pixels[i] = ANIM_COLOR + else: + for j in range(16): + trellis.pixels[j] = ANIM_COLOR time.sleep(.05) - trellis.pixels[i] = OFF + trellis.pixels[j] = OFF time.sleep(.05) - + # turn the LED off when a rising edge is detected elif event.edge == NeoTrellis.EDGE_FALLING: trellis.pixels[event.number] = random.choice([RED, YELLOW, GREEN, CYAN, BLUE, PURPLE]) @@ -70,4 +71,4 @@ while True: # call the sync function call any triggered callbacks trellis.sync() # the trellis can only be read every 17 millisecons or so - time.sleep(.02) \ No newline at end of file + time.sleep(.02)