Open embedded-creations opened 5 years ago
Perhaps it would be useful to describe the issue in hand. The crux of the problem is this line. char noise[][]
has the same dimensions as the matrix layout. That line indexes into noise[][] with both [x][y] and [y][x]. Clearly, this will never work for non-square layouts.
I can't fathom whether or not FastLED's noise function is periodic. I was hoping some modulus operation might be an efficient way to deal with rectangular layouts. Instead, I chose to simply grow noise[][] to be large enough for either axis.
Things I've learned since opening this PR:
fillnoise8()
I see at least 3 possible futures. I'm not experienced enough in C/C++/SmartMatrix to have a worthwhile opinion on style, so it falls to you to choose between them, or something else entirely. Personally, I spray #define
s everywhere. I'm aware that this is anathema to others. Regardless of your preference, I'm happy to press the appropriate buttons to get this PR into a mergeable state.
const uint
, in the style of the current PR.const uint
.#define MAX_DIMENSION_OVERALL
, to match the style of FastLED+APA102. Initially, I had a similar name, but then I remembered INT_MAX
et al, and decided that MAX shouldn't be in the name, hence kMatrixLongestSide
.Thanks for your PR and nice comments about the project!
My preference is 2, I'd be happy with 1 if you don't want to go through the extra effort.
Should FastLED_Functions example calculate noise based on height/width in a different way?
There seems to be a seam at 32 pixels wide when driving a 32x64 panel