Short version: I finally actually banged around enough to make a pattern that does what I want from scratch. Really, the goal was just to have a sine wave scroll across the matrix. Ended up with a sine wave with a wavelength that’s a sine wave. Here it is:
Long version: I’ve owned a pixelblaze since March, 2018. I have one as bias lighting for my TV, lighting around a recessed boardgame table, and up and over the archway between my living room and dining room, but I pretty much always use pre-made patterns. At most, I edit a few variables in existing ones to change the scale or color, but it’s just through trial and error. My programming experience was basically zero and my actual math classes stopped at polynomial functions so I pretty quickly gave up on writing anything interesting myself.
In 2020 I tried learning C, and it made me confident enough to try some arduino stuff. I got tired of “example” projects and really needed something to DO to practice programming, so I figured I should bang my head against pixelblaze some more.
So over the last couple days I set out to write my own pattern without trying to look at other patterns or use example code, and truly just bash my head against it until it made sense. I love working with LEDs because it can help my visualize what is happening in my code, and I often end up debugging by just outputting some variable as the value for the LEDs, like a visual var watcher.
After getting it “done” the first time, I either closed my laptop too quickly or unplugged the pixelblaze too quickly, and my pattern was corrupted, and couldn’t load. Was going to post to see if anyone could help me recover it, but I figured if I actually learned anything by making it, I should be able to do it again. So I remade it, a little better than the first time.
I was expecting the mapper to give me something like a 2D array with the index stored in the X, Y value, and to be working on individual pixels rather than something more scalable. but after seeing what playing with the scale of the “close enough to the curve to light up” variable in functions in some example code that used the mapper values, I saw how good the brain was at filling in the “missing” parts of the pattern, and almost seeing it as a pattern that is behind the PCB, and the LEDs are holes that it shines through. So I accepted my 0…1 values for X and Y and tried to do it the “right” way.
I look forward to trying to actually implement the rest of my idea and realizing that I have to remake everything in an entirely different way to allow for something I want in the future.