Skip to content

Commit

Permalink
Merge pull request #21 from rowlap/modulo-fix
Browse files Browse the repository at this point in the history
Fix off-by-one modulo bug in ring() and single()
  • Loading branch information
Gadgetoid authored Oct 30, 2019
2 parents 21369be + 63b4f16 commit a7d1514
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 a7d1514

Please sign in to comment.