Skip to content

Feature/pixel range list#1

Open
ben-xo wants to merge 26 commits into
release/ben-xo-integration-branchfrom
feature/pixel-range-list
Open

Feature/pixel range list#1
ben-xo wants to merge 26 commits into
release/ben-xo-integration-branchfrom
feature/pixel-range-list

Conversation

@ben-xo

@ben-xo ben-xo commented Aug 2, 2021

Copy link
Copy Markdown
Owner

Background

version of FastLED which allows you to render a linked list of pixel ranges, which can be backed by different segments from the same LED buffer.

Builds on work in my previous PRs (FastLED#2)

Probably needs bit more work to work on other pixel controllers than the Clockless Trinket, but I can't test those.

There are 3 example sketches, I've attached videos for two of them.

"Scrolling Comet" demo:

A rotating "comet" (a white pixel followed by a trail) is rotated around an entire strip just by manipulating the length of the ranges surrounding the comet. This is PixelRangeScrollingComet.ino.

Of note, is that, even though the strip is 60 pixels long (so would be >180 bytes of CRGB just for the pixels), the entire sketch only needs 158 bytes of RAM because there are only 17 LEDs in RAM (16 for the comet and 1 for "space" i.e. black, a single pixel with skip=0 which is rendered where the comet is not.) The comet is rendered once, and on each frame 3 ranges are manipulated: start, middle and end. When the comet is fully within the strip, start and end are varying lengths of 1px black, and the comet is rendered as is. When the comet overlaps the end of the strip, start and end are parts of the comet, with middle being black for STRIP_LENGTH - COMET_LENGTH pixels.

148664128-7a14449e-df8b-4757-8850-91bbad09e159.mp4

ben-xo added 9 commits January 6, 2022 23:38
For many WS2811 strips, we can relax the clearing of interrupts down to protecting the timing of the shortest pulse. Your interrupts must still be very very fast in order for the strip not to latch part-way through.
* factor out the clock juggler
* wrap showRGBInternal() in order to be fast enough
The example rotates a white dot around the LED strip, whilst remixing segments of the strip randomly.
@ben-xo
ben-xo force-pushed the feature/pixel-range-list branch from 0364c62 to 48e026c Compare January 6, 2022 23:39
@ben-xo

ben-xo commented Jan 9, 2022

Copy link
Copy Markdown
Owner Author

Here's another example. It loops a white dot along the strip, but the six ranges of LEDs which are rendered to the strip are randomly changed and potentially reversed every 2.5 seconds. As you can see, the same sub-range of pixels is often rendered more than once on the same frame.

PixelRangeRandomiser.ino:

127929727-221d150d-17b6-4e31-8a5b-a2d7ec4d71ff.1.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant