Skip to content

Some Modernization updates for #1208 - #1218

Merged
kriegsman merged 2 commits into
FastLED:masterfrom
marmilicious:master
Apr 10, 2021
Merged

kriegsman merged 2 commits into
FastLED:masterfrom
marmilicious:master

Conversation

@marmilicious

Copy link
Copy Markdown
Contributor

As suggested in #1208 this updates:
LEDS.[function] to FastLED.[function]
Switch from byte to uint8_t
Use uint16_t for all LED index variables
Remove messages about minimum version

As suggested in #1208 this updates:
LEDS.[function] to FastLED.[function]
Switch from byte to uint8_t
Use uint16_t for all LED index variables
Remove messages about minimum version
@kriegsman

Copy link
Copy Markdown
Member

This is great. Thank you so much for moving this forward, and it's so nice not to see things like 'byte' in there any more.

The only question I'm thinking about is whether in the XYmatrix examples, whether the X and Y indicies should be 16-bit themselves, or just the "which pixel number" indicies. If we leave the X and Y indicies at 8 bits each, we can still handle a matrix up to 256x256 pixels with no code change, and everyone with smaller matrices would still get the speed benefits, at least on 8-bit microcontrollers like AVR. OK, now that I've talked it through, I think that's the way to go: use 8-bit indicies for X and Y values, but make sure that the 'pixel number' indicies are all 16-bit. If you would make that change, I'll accept and merge the PR right away.

Thanks again for all the help. It really makes a difference.

@marmilicious

Copy link
Copy Markdown
Contributor Author

I did wonder about that and was trying to think what a more edge like case might be. Perhaps someone making something like a 400x8 matrix for a scrolling text marque? I'll switch that back though.

Matrix examples x,y indicies changed back to uint8_t but returned pixel number kept as uint16_t

Added "Params for width and height" and "Param for different pixel layouts"  comment lines to match other matrix examples.

In NoisePlayground changed
#define kMatrixWidth to const uint8_t kMatrixWidth to match format in other matrix examples.
@marmilicious

Copy link
Copy Markdown
Contributor Author

@kriegsman I wasn't sure if this was ok, or if you would like me to delete my first PR and submit a new one? If you have a preference or suggestion for the future please let me know. I'm still a bit green when it comes to doing PRs, but am happy to learn and help out where I can.

@kriegsman
kriegsman merged commit 1a273c8 into FastLED:master Apr 10, 2021
@kriegsman

Copy link
Copy Markdown
Member

Looks great! Thank you so much for helping out with this, especially because the example sketches are where everyone starts out, and so improvements there help them get started more quickly and more easily and on the right track. Very much appreciated.

@elliottkember

Copy link
Copy Markdown
Contributor

I did wonder about that and was trying to think what a more edge like case might be. Perhaps someone making something like a 400x8 matrix for a scrolling text marque? I'll switch that back though.

@marmilicious This has actually come up for me when writing resolution-independent patterns. Sometimes my matrix is 20x20 and everything is fine, but then other times it's 400x1 for a single strip.

This is fine for me as I redeclare XY() with 16-bit x and y parameters, but might be worth considering!

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.

3 participants