Last active
April 25, 2019 10:44
-
-
Save huhn511/4e580271c8d13714c8c2f1629c4bc4f6 to your computer and use it in GitHub Desktop.
Light example with NeoPixel and ESP8266
This file contains hidden or 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 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