@@ -26,7 +26,7 @@ void threeSine() {
2626 byte sinDistanceG = qmul8 (abs (y * (255 / kMatrixHeight ) - sin8 (sineOffset * 10 + x * 16 )), 2 );
2727 byte sinDistanceB = qmul8 (abs (y * (255 / kMatrixHeight ) - sin8 (sineOffset * 11 + x * 16 )), 2 );
2828
29- leds [XY (x , y )] = CRGB (255 - sinDistanceR , 255 - sinDistanceG , 255 - sinDistanceB );
29+ leds [XY (x , y , 0 , 0 )] = CRGB (255 - sinDistanceR , 255 - sinDistanceG , 255 - sinDistanceB );
3030 }
3131 }
3232
@@ -70,7 +70,7 @@ void plasma() {
7070 for (int x = 0 ; x < kMatrixWidth ; x ++ ) {
7171 for (int y = 0 ; y < kMatrixHeight ; y ++ ) {
7272 byte color = sin8 (sqrt (sq (((float )x - 7.5 ) * 10 + xOffset - 127 ) + sq (((float )y - 2 ) * 10 + yOffset - 127 )) + offset );
73- leds [XY (x , y )] = CHSV (color , 255 , 255 );
73+ leds [XY (x , y , 0 , 0 )] = CHSV (color , 255 , 255 );
7474 }
7575 }
7676
@@ -100,7 +100,7 @@ void rider() {
100100 brightness = 255 - brightness ;
101101 CRGB riderColor = CHSV (cycleHue , 255 , brightness );
102102 for (byte y = 0 ; y < kMatrixHeight ; y ++ ) {
103- leds [XY (x , y )] = riderColor ;
103+ leds [XY (x , y , 0 , 0 )] = riderColor ;
104104 }
105105 }
106106
@@ -133,7 +133,7 @@ void colorFill() {
133133 for (byte x = 0 ; x < kMatrixWidth ; x ++ ) {
134134 byte y = currentRow ;
135135 if (currentDirection == 2 ) y = kMatrixHeight - 1 - currentRow ;
136- leds [XY (x , y )] = currentPalette [currentColor ];
136+ leds [XY (x , y , 0 , 0 )] = currentPalette [currentColor ];
137137 }
138138 }
139139
@@ -143,7 +143,7 @@ void colorFill() {
143143 for (byte y = 0 ; y < kMatrixHeight ; y ++ ) {
144144 byte x = currentRow ;
145145 if (currentDirection == 3 ) x = kMatrixWidth - 1 - currentRow ;
146- leds [XY (x , y )] = currentPalette [currentColor ];
146+ leds [XY (x , y , 0 , 0 )] = currentPalette [currentColor ];
147147 }
148148 }
149149
@@ -174,8 +174,8 @@ void sideRain() {
174174
175175 scrollArray (rainDir );
176176 byte randPixel = random8 (kMatrixHeight );
177- for (byte y = 0 ; y < kMatrixHeight ; y ++ ) leds [XY ((kMatrixWidth - 1 ) * rainDir , y )] = CRGB ::Black ;
178- leds [XY ((kMatrixWidth - 1 )* rainDir , randPixel )] = CHSV (cycleHue , 255 , 255 );
177+ for (byte y = 0 ; y < kMatrixHeight ; y ++ ) leds [XY ((kMatrixWidth - 1 ) * rainDir , y , 0 , 0 )] = CRGB ::Black ;
178+ leds [XY ((kMatrixWidth - 1 )* rainDir , randPixel , 0 , 0 )] = CHSV (cycleHue , 255 , 255 );
179179
180180}
181181
@@ -194,7 +194,7 @@ void confetti() {
194194
195195 // scatter random colored pixels at several random coordinates
196196 for (byte i = 0 ; i < 4 ; i ++ ) {
197- leds [XY (random16 (kMatrixWidth ), random16 (kMatrixHeight ))] = ColorFromPalette (currentPalette , random16 (255 ), 255 ); //CHSV(random16(255), 255, 255);
197+ leds [XY (random16 (kMatrixWidth ), random16 (kMatrixHeight ), 0 , 0 )] = ColorFromPalette (currentPalette , random16 (255 ), 255 ); //CHSV(random16(255), 255, 255);
198198 random16_add_entropy (1 );
199199 }
200200}
@@ -233,7 +233,7 @@ void myConfetti() {
233233
234234// scatter random colored pixels at several random coordinates
235235 for (byte i = 0 ; i < 4 ; i ++ ) {
236- leds [XY (random16 (kMatrixWidth ), random16 (kMatrixHeight ))] = ColorFromPalette (MyColors_p , random16 (255 ), 255 ); //CHSV(random16(255), 255, 255);
236+ leds [XY (random16 (kMatrixWidth ), random16 (kMatrixHeight ), 0 , 0 )] = ColorFromPalette (MyColors_p , random16 (255 ), 255 ); //CHSV(random16(255), 255, 255);
237237 random16_add_entropy (1 );
238238 }
239239
@@ -263,7 +263,7 @@ void slantBars() {
263263
264264 for (byte x = 0 ; x < kMatrixWidth ; x ++ ) {
265265 for (byte y = 0 ; y < kMatrixHeight ; y ++ ) {
266- leds [XY (x , y )] = CHSV (cycleHue , 255 , quadwave8 (x * 32 + y * 32 + slantPos ));
266+ leds [XY (x , y , 0 , 0 )] = CHSV (cycleHue , 255 , quadwave8 (x * 32 + y * 32 + slantPos ));
267267 }
268268 }
269269
@@ -286,7 +286,7 @@ void swirly()
286286 // blur it repeatedly. Since the blurring is 'lossy', there's
287287 // an automatic trend toward black -- by design.
288288 uint8_t blurAmount = beatsin8 (2 ,10 ,255 );
289- blur2d ( leds , kMatrixWidth , kMatrixHeight , blurAmount );
289+ blur2d (leds , kMatrixWidth , kMatrixHeight , blurAmount , myXYMap );
290290
291291 // Use two out-of-sync sine waves
292292 uint8_t i = beatsin8 ( 27 , kBorderWidth , kMatrixHeight - kBorderWidth );
@@ -297,12 +297,12 @@ void swirly()
297297
298298 // The color of each point shifts over time, each at a different speed.
299299 uint16_t ms = millis ();
300- leds [XY ( i , j )] += CHSV ( ms / 11 , 200 , 255 );
301- leds [XY ( j , i )] += CHSV ( ms / 13 , 200 , 255 );
302- leds [XY (ni ,nj )] += CHSV ( ms / 17 , 200 , 255 );
303- leds [XY (nj ,ni )] += CHSV ( ms / 29 , 200 , 255 );
304- leds [XY ( i ,nj )] += CHSV ( ms / 37 , 200 , 255 );
305- leds [XY (ni , j )] += CHSV ( ms / 41 , 200 , 255 );
300+ leds [XY (i , j , 0 , 0 )] += CHSV ( ms / 11 , 200 , 255 );
301+ leds [XY (j , i , 0 , 0 )] += CHSV ( ms / 13 , 200 , 255 );
302+ leds [XY (ni ,nj , 0 , 0 )] += CHSV ( ms / 17 , 200 , 255 );
303+ leds [XY (nj ,ni , 0 , 0 )] += CHSV ( ms / 29 , 200 , 255 );
304+ leds [XY (i ,nj , 0 , 0 )] += CHSV ( ms / 37 , 200 , 255 );
305+ leds [XY (ni , j , 0 , 0 )] += CHSV ( ms / 41 , 200 , 255 );
306306
307307 FastLED .show ();
308308}
0 commit comments