Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
index = 0
elif last:
index = len(LED_GPIO)-1
elif left:
if index > 0:
index -= 1
elif right:
if index < len(LED_GPIO)-1:
index += 1
# FLASH PRESENTLY SELECTED LED
GPIO.output(LED_GPIO[index], True)
time.sleep(FLASH_TIME/2)
GPIO.output(LED_GPIO[index], False)
time.sleep(FLASH_TIME/2)
elif last:
index = len(LED_GPIO)-1
elif left:
if index > 0:
index -= 1
elif right:
if index < len(LED_GPIO)-1:
index += 1
# FLASH PRESENTLY SELECTED LED
GPIO.output(LED_GPIO[index], True)
time.sleep(FLASH_TIME/2)
GPIO.output(LED_GPIO[index], False)
time.sleep(FLASH_TIME/2)
def setup():
GPIO.setmode(GPIO.BCM)
for l in LED_GPIO:
GPIO.setup(l, GPIO.OUT)
GPIO.output(l, False)
for b in BUTTON_GPIO:
GPIO.setup(b, GPIO.IN)