Fix initial offset calculation when reversed in chase.py#129
Merged
dhalbert merged 1 commit intoadafruit:mainfrom Jul 31, 2025
Merged
Fix initial offset calculation when reversed in chase.py#129dhalbert merged 1 commit intoadafruit:mainfrom
dhalbert merged 1 commit intoadafruit:mainfrom
Conversation
Found a bug in the chase animation when reverse is set to True which results in the animation being offset by the length of the size parameter. You can observe this by setting up two animations of equal length on a single strip of pixels with the second one reversed. The bars should appear to meet in the middle but don't.
Example:
pixels = neopixel.NeoPixel(board.A0, 22, auto_write=False, brightness = .5)
left_pixels = PixelSubset(pixels, 0, 11)
right_pixels = PixelSubset(pixels, 11, 22)
left_animation = Chase(
left_pixels, speed=.5, color=CYAN, size=2, spacing=11
)
right_animation = Chase(
right_pixels, speed=.5, color=CYAN, size=2, spacing=11, reverse=True
)
animations = AnimationSequence(
AnimationGroup(
left_animation,
right_animation,
sync=True
),
auto_clear=True,
auto_reset=True,
)
while True:
animations.animate()
dhalbert
approved these changes
Jul 31, 2025
adafruit-adabot
added a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Aug 1, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 to 2.1.0 from 2.0.4: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#36 from tannewt/magtag2025 Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.12.3 from 2.12.2: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#129 from hberg32/patch-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found a bug in the chase animation when reverse is set to True which results in the animation being offset by the length of the size parameter. You can observe this by setting up two animations of equal length on a single strip of pixels with the second one reversed. The bars should appear to meet in the middle but don't. We could consider removing _num_repeats and _overflow as they don't appear to be used (at least, searching this repo didn't turn up any hits)
Example: