Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created October 30, 2013 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobjoaquin/7235898 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/7235898 to your computer and use it in GitHub Desktop.
For "Eyes that Follow" Instructable. Lights up 10 NeoPixels the color red with an Adafruit Gemma.
#include <Adafruit_NeoPixel.h>
#define NUM_LEDS 10
#define PIN 0
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
setAll(strip.Color(255, 0, 0));
strip.show();
}
void loop() {
}
void setAll(uint32_t theColor) {
for(uint16_t i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, theColor);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment