Skip to content

Commit

Permalink
adding arduino sparkle motion mini example
Browse files Browse the repository at this point in the history
  • Loading branch information
BlitzCityDIY committed Jan 22, 2025
1 parent b477820 commit 94ce890
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-FileCopyrightText: 2025 Liz Clark for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include <Adafruit_NeoPixel.h>

#define BLOCK_1 33
#define BLOCK_2 32
#define NUM_PIXELS 8

Adafruit_NeoPixel STRIP_1(NUM_PIXELS, BLOCK_1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel STRIP_2(NUM_PIXELS, BLOCK_2, NEO_GRB + NEO_KHZ800);

void setup() {
Serial.begin(115200);

STRIP_1.begin();
STRIP_2.begin();
}

uint16_t pixelHue_1 = 0;
uint16_t pixelHue_2 = 256;

void loop() {
pixelHue_1 += 256;
for(int i=0; i<STRIP_1.numPixels(); i++) {
int pixelHue_1 = pixelHue_1 + (i * 65536L / STRIP_1.numPixels());
STRIP_1.setPixelColor(i, STRIP_1.gamma32(STRIP_1.ColorHSV(pixelHue_1)));
}
STRIP_1.show();

pixelHue_2 -= 256;
for(int i=0; i<STRIP_2.numPixels(); i++) {
int pixelHue_2 = pixelHue_2 + (i * 65536L / STRIP_2.numPixels());
STRIP_2.setPixelColor(i, STRIP_2.gamma32(STRIP_2.ColorHSV(pixelHue_2)));
}
STRIP_2.show();

delay(10);

}

0 comments on commit 94ce890

Please sign in to comment.