Created
March 7, 2024 19:41
-
-
Save companje/954ee3647bd1f0be3880edb57c609692 to your computer and use it in GitHub Desktop.
RGBW LEDs with Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#define LED_PIN 3 | |
#define LED_COUNT 163 | |
#define DELAYVAL 25 | |
int i=0; | |
Adafruit_NeoPixel pixels(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800); | |
void setup() { | |
pixels.begin(); | |
} | |
void loop() { | |
pixels.clear(); | |
for (int j=0; j<10; j++) { | |
int index = (i+j) % LED_COUNT; | |
pixels.setPixelColor(index, pixels.Color(0, 0, 0, 255)); | |
} | |
pixels.show(); | |
delay(DELAYVAL); | |
if (++i>=LED_COUNT) i=0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment