Skip to content

Instantly share code, notes, and snippets.

@huhn511
Last active April 25, 2019 10:44
Show Gist options
  • Save huhn511/4e580271c8d13714c8c2f1629c4bc4f6 to your computer and use it in GitHub Desktop.
Save huhn511/4e580271c8d13714c8c2f1629c4bc4f6 to your computer and use it in GitHub Desktop.
Light example with NeoPixel and ESP8266
#include <Adafruit_NeoPixel.h>
#define PIN 5
int numPixels = 12;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixels, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.setBrightness(15);
strip.show();
}
uint32_t red = strip.Color(255, 0, 0);
uint32_t blue = strip.Color(0, 0, 255);
void loop() {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, blue);
strip.show();
delay(1000); .
strip.setPixelColor(i, red);
strip.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment