Skip to content
Snippets Groups Projects
Commit 242067d0 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Fix off by one error in LED blinking

parent c679bcc5
Branches
No related tags found
No related merge requests found
...@@ -116,14 +116,14 @@ def set_led(ledstate, config): ...@@ -116,14 +116,14 @@ def set_led(ledstate, config):
if ledstate in ["success", "ok", "200"]: if ledstate in ["success", "ok", "200"]:
# Display the fitting LED color for the state at the given repetition # Display the fitting LED color for the state at the given repetition
for i in range(config["led"]["success_repetitions"]): for i in range(config["led"]["success_repetitions"] + 1):
LEDS.fill(repeat(config["led"]["success_color"], i)) LEDS.fill(repeat(config["led"]["success_color"], i))
time.sleep(repeat(config["led"]["success_on_time"], i)) time.sleep(repeat(config["led"]["success_on_time"], i))
LEDS.fill((0, 0, 0)) LEDS.fill((0, 0, 0))
time.sleep(repeat(config["led"]["success_off_time"], i)) time.sleep(repeat(config["led"]["success_off_time"], i))
elif ledstate in ["failure", "error", "fail", "404"]: elif ledstate in ["failure", "error", "fail", "404"]:
# Display the fitting LED color for the state at the given repetition # Display the fitting LED color for the state at the given repetition
for i in range(config["led"]["failure_repetitions"]): for i in range(config["led"]["failure_repetitions"] + 1):
LEDS.fill(repeat(config["led"]["failure_color"], i)) LEDS.fill(repeat(config["led"]["failure_color"], i))
time.sleep(repeat(config["led"]["failure_on_time"], i)) time.sleep(repeat(config["led"]["failure_on_time"], i))
LEDS.fill((0, 0, 0)) LEDS.fill((0, 0, 0))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment