Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexey-bass/b186b60a8a96e88ded135275556fce25 to your computer and use it in GitHub Desktop.
Save alexey-bass/b186b60a8a96e88ded135275556fce25 to your computer and use it in GitHub Desktop.
/**
To program lite version, choose
Generic ESP8266 Module, 80 Mhz, 40 Mhz, DOUT, 921600, 1M (512K SPIFFS), nodemcu, Disabled, None
DOUT and nodemcu!
*/
#include "ESP8266WiFi.h"
#include <Adafruit_NeoPixel.h>
#define PIN 4
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
pixels.setPixelColor(0, pixels.Color(i * 255, j * 255, k * 255)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(200); // Delay for a period of time (in milliseconds).
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment