Skip to content

Commit 94ce890

Browse files
committed
adding arduino sparkle motion mini example
1 parent b477820 commit 94ce890

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
#include <Adafruit_NeoPixel.h>
6+
7+
#define BLOCK_1 33
8+
#define BLOCK_2 32
9+
#define NUM_PIXELS 8
10+
11+
Adafruit_NeoPixel STRIP_1(NUM_PIXELS, BLOCK_1, NEO_GRB + NEO_KHZ800);
12+
Adafruit_NeoPixel STRIP_2(NUM_PIXELS, BLOCK_2, NEO_GRB + NEO_KHZ800);
13+
14+
void setup() {
15+
Serial.begin(115200);
16+
17+
STRIP_1.begin();
18+
STRIP_2.begin();
19+
}
20+
21+
uint16_t pixelHue_1 = 0;
22+
uint16_t pixelHue_2 = 256;
23+
24+
void loop() {
25+
pixelHue_1 += 256;
26+
for(int i=0; i<STRIP_1.numPixels(); i++) {
27+
int pixelHue_1 = pixelHue_1 + (i * 65536L / STRIP_1.numPixels());
28+
STRIP_1.setPixelColor(i, STRIP_1.gamma32(STRIP_1.ColorHSV(pixelHue_1)));
29+
}
30+
STRIP_1.show();
31+
32+
pixelHue_2 -= 256;
33+
for(int i=0; i<STRIP_2.numPixels(); i++) {
34+
int pixelHue_2 = pixelHue_2 + (i * 65536L / STRIP_2.numPixels());
35+
STRIP_2.setPixelColor(i, STRIP_2.gamma32(STRIP_2.ColorHSV(pixelHue_2)));
36+
}
37+
STRIP_2.show();
38+
39+
delay(10);
40+
41+
}

0 commit comments

Comments
 (0)