VERY new to coding and LED control in general. Using a continuous LED strip, I have added light to a cosplay sword, but in my design process I did not do a standard zig zag. Rather, there are four rows where it starts up on row one, down on row 3, up on row 2, then down on row 4. This has made my attempt to map a bit hellish, and makes patterns not behave correctly on all my attempts.
Unfortunately, the LEDs are sealed inside the sword now, so physical changes are not possible.
I haven’t had much luck futzing around, nothing seems to make a major difference. Would appreciate help figuring out how to swap row 2 and 3 on a standard zig zag.
function (pixelCount) {
width = 63
var map =
for (i = 0; i < pixelCount; i++) {
x = Math.floor(i / width)
y = i % width
// y = x % 2 == 1 ? width - 1 - y : y; //zigzag
if (x == 0){
x = 0
}
else if (x == 1){
x = 2
}
else if (x == 2){
x = 1
}
else if (x == 3){
x = 3
}
map.push([x, y])
}
return map
}
here is the start of what I’ve concocted, it gets close but something still isn’t working
Hi there, what is the issue with how its mapping? Some patterns arent made for 2d and wont look right even if your map is correct. I have the same issue with many patterns on my mandala because some patterns just go by index number and not map coords.