Does anyone have any knowledge of some example code that would cause random sections of an LED strip to fade to a color and then another random section fade to another color, etc.? I’m looking to create almost a ‘bubbling’ effect. Just poking around here to see if anyone’s already done something similar. Thanks!
marmil
(Marc Miller)
January 23, 2018, 8:33am
2
These might give you some ideas to explore.
//***************************************************************
// Example of blending from one color to a target color.
// Once the target color is reached a new random target color
// is picked to blend toward.
//
// leds[0] always displays the target color.
//
// Marc Miller, Feb 2017
//***************************************************************
#include "FastLED.h"
#define DATA_PIN 11
#define CLK_PIN 13
#define LED_TYPE LPD8806
#define COLOR_ORDER GRB
#define NUM_LEDS 32
#define BRIGHTNESS 100
CRGB leds[NUM_LEDS];
uint8_t blendRate = 50; // How fast to blend. Higher is slower. [milliseconds]
This file has been truncated. show original
// Test of chasing random target values, version B.
//
// Random target values are generated and assigned to random pixels.
// Pixel brightness is then increased or decreased toward the target.
//
// This version incorporates a hue shift based on the pixel value.
// The high and low color choices can be changed below in the variables.
// Saturation is kept at full, but it could also easily be tweaked.
//
// Marc Miller, April 2015
//---------------------------------------------------------------
#include "FastLED.h"
#define LED_TYPE NEOPIXEL // *Update to your strip type. NEOPIXEL, APA102, LPD8806, etc..
#define DATA_PIN 6 // *Set this to your data pin.
#define NUM_LEDS 12 // *Update to the number of pixels in your strip.
//#define COLOR_ORDER BGR
#define MASTER_BRIGHTNESS 255
CRGB leds[NUM_LEDS];
This file has been truncated. show original