From 63b4f16b7b2cb16033994c305e5d1d336559a7f6 Mon Sep 17 00:00:00 2001 From: rowlap Date: Sun, 27 Oct 2019 19:28:53 +0000 Subject: [PATCH] Fix off-by-one modulo bug in ring() and single() --- library/piglow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/piglow.py b/library/piglow.py index f8ba414..5795aa4 100644 --- a/library/piglow.py +++ b/library/piglow.py @@ -177,7 +177,7 @@ def _set(leds, value): def ring(ring_index, value): """Set the brightness of a specific ring""" - ring_index %= 7 + ring_index %= 6 _set([_legs[0][ring_index], _legs[1][ring_index], _legs[2][ring_index]], value) @@ -227,7 +227,7 @@ def single(leg_index, ring_index, intensity): """ - _set(_legs[leg_index % 3][ring_index % 7], intensity) + _set(_legs[leg_index % 3][ring_index % 6], intensity) def tween(duration, end, start=None):