Created
February 3, 2021 02:09
-
-
Save mpflaga/5593dbe09875dce8a91008366f749160 to your computer and use it in GitHub Desktop.
Simple Arudino to test a string of NeoPixels. One LED scrolls out the length, as to reduce power constraints
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> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
#define PIN 6 | |
#define NUMPIXELS 200 | |
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
#define DELAYVAL 1 // Time (in milliseconds) to pause between pixels | |
void setup() { | |
pixels.begin(); | |
} | |
void loop() { | |
pixels.clear(); | |
for(int i=0; i<NUMPIXELS; i++) { | |
pixels.setPixelColor(i-1, pixels.Color(0, 0, 0)); | |
pixels.setPixelColor(i, pixels.Color(128, 128, 128)); | |
pixels.show(); | |
delay(DELAYVAL); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment