Skip to content

Commit

Permalink
Fix off-by-one modulo bug in ring() and single()
Browse files Browse the repository at this point in the history
  • Loading branch information
rowlap committed Oct 27, 2019
1 parent 21369be commit 63b4f16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/piglow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 63b4f16

Please sign in to comment.