Skip to content

Instantly share code, notes, and snippets.

@mpflaga
Created February 3, 2021 02:09
Show Gist options
  • Save mpflaga/5593dbe09875dce8a91008366f749160 to your computer and use it in GitHub Desktop.
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
#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