// NeoPixel test program showing use of the WHITE channel for RGBW // pixels only (won't look correct on regular RGB NeoPixel strips). #include #ifdef __AVR__ #include // Required for 16 MHz Adafruit Trinket #endif #define LED_PIN 8 //5pin on ATtiny44 // How many NeoPixels are attached to the Arduino? #define LED_COUNT 15 // NeoPixel brightness, 0 (min) to 255 (max) #define BRIGHTNESS 50 // Declare our NeoPixel strip object: Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800); // Argument 1 = Number of pixels in NeoPixel strip // Argument 2 = Arduino pin number (most are valid) // Argument 3 = Pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) void setup() { strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) strip.show(); // Turn OFF all pixels ASAP strip.setBrightness(BRIGHTNESS); // Set BRIGHTNESS to about 1/5 (max = 255) } void loop() { // Fill along the length of the strip in various colors... colorWipe(strip.Color(255, 0, 0, 0) , 50); // Red colorWipe(strip.Color(0, 255, 0, 0) , 50); // Green colorWipe(strip.Color(0, 0, 255, 0) , 50); // Blue colorWipe(strip.Color(0, 0, 0, 255), 50); // True white (not RGB white) } // Fill strip pixels one after another with a color. Strip is NOT cleared // first; anything there will be covered pixel by pixel. Pass in color // (as a single 'packed' 32-bit value, which you can get by calling // strip.Color(red, green, blue) as shown in the loop() function above), // and a delay time (in milliseconds) between pixels. void colorWipe(uint32_t color, int wait) { for(int i=0; i