Hey! I'd really appreciate some help with writing a code. I have a strip of 36 WS2812B LEDs and I want to create 3 zones, each doing their own effect: one will use the FastLED library and two uses the WS2812FX library.
ZONE 1: FastLED library
LEDs 0-3 are to be black at the moment, I will assign each LED individually using RGB pallet.
ZONE 2: WS2812FX library
LEDs 4-13 will be Larson Scanner
ZONE 3: WS2812FX library
LEDs 14-36 will be Hyper Sparkle
CODE FOR ZONE 1
//ZONE 1
#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 36
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define BRIGHTNESS 200
CRGB leds[NUM_LEDS];
void setup() {
delay(100);
LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
// LEDS.addLeds<LED_TYPE, LED_PIN, CLOCK_PIN COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
leds[0] = CRGB(0, 0, 0);
FastLED.show();
leds[1] = CRGB(0, 0, 0);
FastLED.show();
leds[2] = CRGB(0, 0, 0);
FastLED.show();
leds[3] = CRGB(0, 0, 0);
FastLED.show();
}
CODE FOR ZONE 1
//ZONE 2
#include <WS2812FX.h>
#define LED_COUNT 36
#define LED_PIN 7
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
ws2812fx.init();
ws2812fx.setBrightness(45);
ws2812fx.setColor(0xFF1000);
ws2812fx.setSpeed(3500);
ws2812fx.setMode(FX_MODE_LARSON_SCANNER);
ws2812fx.start();
}
void loop() {
ws2812fx.service();
}
//ZONE 3
#include <WS2812FX.h>
#define LED_COUNT 36
#define LED_PIN 7
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
ws2812fx.init();
ws2812fx.setBrightness(105);
ws2812fx.setColor(0xFF1000);
ws2812fx.setSpeed(500);
ws2812fx.setMode(FX_MODE_HYPER_SPARKLE);
ws2812fx.start();
}
void loop() {
ws2812fx.service();
}
I've been scratching me head for days and looked for solutions before posting here. I'm at a loss and any help is greatly appreciated.
Thank you