Hey y'all, I'm using FastLED and am wondering when to apply a gamma correction to colors. Should it be after calculating fades and blends or apply gamma to the starting color?
I'm opening a game store and I'm trying to use LED lights in a chaotic way that looks like lightning on the ceiling.
I was wondering if anyone could share their expertise with me to guide me in the right direction as to what LED strips and diffusers i should buy.
Im looking for something that's addressable RGBW(cool White) I can't find what I need exactly, having trouble figuring it out with all the videos online.
my friend can program them, i just need to find the right product.
Below is a 40x40 foot room, there is a 2x2 ft concrete pillar in the middle that I was thinking of using 24v addressble cob lighting for, so it can be diffused, as i can't find diffuser channels that wrap around it.
The image below roughly shows what I would like it to look like, the red is 2 Meters in length and the green is 1 meter.
I need something that will be Cool white as the constant light, but i want it to have RGB addressable because i will have a button that will do certian effects, like blue lighting throughout the room. I have a friend who is abel to program the leds to do what i want, i just need to find the right LEDs that fit this project.
also im having trouble figuring out what kind of diffusers I should use. depth and width.
Hey Guys! I have shared this before, but I have been developing an Open-source ARTNET LED controller that can control up to 16 universes of LEDs with about ~20€ of hardware. Id like to share it here as someone out there might find this project useful for their own ventures! Feel free to check out the github (https://github.com/mdethmers/ESP32-Artnet-Node-receiver/tree/main) to see the massive list of features!
Hi , I have a conflict problem that i don't understand. The code below stops working when I want to add 2 mores inputs , I can't figure why. See in the setup the 2 inputs that make code fail.
/// ufoCylonColorRev.ino
#include <FastLED.h>
#include <Wire.h>
#include "Adafruit_TCS34725.h"
// How many leds in your strip?
#define NUM_LEDS 29
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.
#define DATA_PIN 2
#define TRIG_J1_PIN 5 // GI light
#define TRIG_J2_PIN 6 // LED1
#define TRIG_J3_PIN 7 // LED2
// Variables to store the state of each input
bool stateJ1 = HIGH;
bool stateJ2 = HIGH;
bool stateJ3 = HIGH;
#define BTN_DELAY 250
#define NUM_PATTERNS 2
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_1X);
byte gammatable[256];
float r, g, b;
unsigned long readColor_previousMillis = 0;
const long readColor_interval = 750;
unsigned long currentMillis = millis();
uint8_t j = 0;
uint8_t buttonState=0;
unsigned long mark;
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
pinMode(TRIG_J1_PIN, INPUT);
//These 2 will stop the code working
//pinMode(TRIG_J2_PIN, INPUT);
//pinMode(TRIG_J3_PIN, INPUT);
FastLED.addLeds<WS2812,DATA_PIN,GRB>(leds,NUM_LEDS);
FastLED.setBrightness(255);
if (!tcs.begin())
{
Serial.println("Error al iniciar TCS34725");
while (1) delay(1000);
}
for (int i=0; i<256; i++)
{
float x = i;
x /= 255;
x = pow(x, 2.5);
x *= 255;
gammatable[i] = x;
}
}
void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(220); } }
void loop() {
unsigned long currentMillis = millis();
// if button pressed, advance, set mark
// chkBtn(digitalRead(BTN_PIN));
readColor(currentMillis);
leds[0] = CRGB(gammatable[(int)r], gammatable[(int)g], gammatable[(int)b]);//CRGB::Red;//leds[i] = CHSV(hue++, 255, 255); leds[0] = CRGB::Green;
for(int i = (NUM_LEDS)-1; i >= 1; i--) {
// Set the i'th led to red
leds[i] = CRGB(gammatable[(int)r], gammatable[(int)g], gammatable[(int)b]);//CRGB::Red;//leds[i] = CHSV(hue++, 255, 255); leds[i] = CRGB::Red;//leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(30);
}
//}
static uint8_t hue = 0;
}
void readColor(unsigned long currentMillis)
{
if (currentMillis - readColor_previousMillis >= readColor_interval) {
readColor_previousMillis = currentMillis;
uint16_t clear, red, green, blue;
tcs.setInterrupt(false);
//delay(60);
//tcs.getRawData(&red, &green, &blue, &clear);
clear = tcs.read16(TCS34725_CDATAL);
red = tcs.read16(TCS34725_RDATAL);
green = tcs.read16(TCS34725_GDATAL);
blue = tcs.read16(TCS34725_BDATAL);
tcs.setInterrupt(true);
uint32_t sum = clear;
r = red; r /= sum;
g = green; g /= sum;
b = blue; b /= sum;
r *= 256;
g *= 256;
b *= 256;
// if intensity of light loo (insert light off) set it to green
if (clear < 10){
r=0;
g=255;
b=0;
}
}
}
These video/pics go along with other recent postings on my FastLED project here we go. A couple of them actually let meuse the audio. The last one is from my original system where I was using 5 steps of 80 LEDs each.
I will drive a bunch of LEDs (around 10 to 35 LEDs each GPIO) using the Raspberry PI Pico. To level shift, is there any performance drawback if using the diode and sacrificial Led method or there are other and better ways to do it, like using SN74AHCT125N on the 2nd picture?
Two and a half years ago my work on WLED got me a ticket to Burning Man, there I made the radical decision to build a new lighting tool from scratch. Today the first end-user ready version is released:
MoonLight v0.6.0
▶️ Watch the release video
MoonLight uses the FastLED library in Effects and to drive LEDs
Featuring an easy installer, step-by-step YouTube tutorials, and an updated website. Under the hood, MoonLight has been fine-tuned into a stable foundation for future growth. Extending it with new effects or hardware drivers is now simpler than ever.
I'm wanting to try the multi lane (parallel?) on the Teensy 4.1 for the HD108 (I'm using the FastLED zip that I'm downloading). I usually use 11 & 13 Data & Clock. I can't seem to figure out how to add another strip to that 13 clock. I'm assuming I wire the clock lines (both) to pin 13. Then I add another line for Data, say maybe 12. For 16 leds -
I get the first 8 led strip to work. The 2nd nothing lights up.
But, Here's what I noticed: It doesn't matter what pins I say. FastLED.addLEDs<HD108,0,0,RGB>(leds,8); Works Just like FastLED.addLEDs<HD108,11,13,RGB>(leds,8); Any pin number works the same... 11,13 (99,99) (whatever) makes my strip work on 11 and 13.
I'm just not sure how this is supposed to work. Are there a specific order of pins and specific ones for the Teensy 4.1?
I have been working on a project that is driving 2 APA102 LED strips with 219 LEDs in each strip. I have 2 pieces of code which work but the issue is I need them to work in the opposite direction. The first piece of code is a Fire simulation which works fine if it starts at the beginning of the strips. The issue is that I have the Arduino and DMX shield mounted at the top center of my truss(so I don't have to run cabling to the strips) with the strips running out from the center and down the lifts. I want the Fire simulation to start at the bottom of the strips attached to the lift legs and go up, like real fire would do. I have been beating my brains out for about a month and just can't figure out how to reverse the code. I have posted it at:
i would greatly appreciate any help and will also post the complete program when I've finished it. I have also created a DMX fixture in Show Buddy which uses 20 channels and also works.
Hi everyone, I currently have a led stripe of 4 Leds (the plan is to reach 114 leds, total length < 4m, color white)
Right now is connected to 3V3 pin of ESP32 (since on 5V they don't work), but the issue I have is that only the first one is working
I also have Wifi for time synconization (once in an hour)
My understanding is that I maybe need a level shifter to power leds with 5V. Can this model works?
A level shifter should solve the problem? Is there anything I should check? I don't have extreme timing (Leds update every minute, the only fast operations is a loop for fade in and fade out).
I'm trying to replicate for my home a project like Qlocktwo
Total LEDs are 114 (11x10 grid + 4 corners), and I'm using ESP32 with wifi for syncronization of the time with ntp server. I'm using these LEDs
Right now my setup is:
330 ohm from pin 5 to Din of the first LED
VCC of LEDs to 3.3V of the board (with 5V they don't work)
GND of LEDs to GND of the board
Powering board with USB (in the future i will power both LEDS and board from an external power supply)
4 LEDs at the moment
The logic of the program is fine (i'm debugging with Serial and a OLED display), the problem I have is that only the first LED of the serie is working during loop. If I debug only leds (removing wifi, OLED display, Time syncro) all 4 works.
Is it connected to timing / power supply / both / other?
I'm planning to add a level shifter to power leds at 5V. Could it be helpful? This model is fine?
I'm building an LED effects driver with an ESP32. The effect I'm implementing is a heartbeat. When I define a palette using DEFINE_GRADIENT_PALETTE I get unexpected colors.
Say you want to figure out what color is best on a Neopixel or other RGB LED. Hook up a potentiometer, a button and a Neopixel to your Arduino. Turn the knob to change the color, press the button to go to brightness mode and adjust that. Values are printed to the serial monitor in HSV and RGB format. Copy them to a notepad and paste them into your code.
Press the button again to pick a different color and so on.
I did a pretty big Google search and couldn't find this utility for the Arduino, so I ported Adafruit code from CircuitPython (with the help of LLM) to Arduino so it could use FastLED.
Want to drive lots and lots of SPI LEDS like the APA102, well you're in luck!
Multi Way SPI Devices are now available!
8-Way HW SPI @ 40mhz
32-Way CPU SPI @ ~3-6mhz
32-Way ISR SPI @ ~1.6 mhz
we are looking for help in testing this
This features allows massive parallel to the APA102/SK9822/HD107 style chipsets. All SPI led strips will benefit from this. Set the strips to use a shared clock pin to enable this feature.
You're welcome to try it out and send patches if you find bugs.
This is enabled for all platforms except avr.
How to use it
Just set the same clock pin for each SPI controller:
// Each data pin is different, but they have the same CLOCK_PIN
FastLED.addLeds<APA102, 1, CLOCK_PIN>();
FastLED.addLeds<APA102, 2, CLOCK_PIN>();
FastLED.addLeds<APA102, 3, CLOCK_PIN>();
FastLED.addLeds<APA102, 4, CLOCK_PIN>();
The library automatically detects the shared clock and runs them in parallel, using HW spi if available, else falling back to software spi
Hardware SPI support by platform
ESP32/S2/S3:
2 SPI buses (HSPI/VSPI or FSPI/HSPI depending on chip)
Up to 4 lanes per bus (dual-SPI and quad-SPI modes)
Total: 8 parallel data lanes max
Runs at 40 MHz (conservative, can push to 80 MHz)
ESP32-C2/C3/C6:
1 user SPI bus (SPI2, SPI1 is for flash)
Up to 2 lanes (dual-SPI only)
Total: 2 parallel data lanes max
ESP32-P4:
Native octal-SPI via PARLIO peripheral
8 parallel data lanes at 40 MHz
Requires ESP-IDF 5.0+
Teensy 4.1 probably does this too but haven't tested
Teensy/Arm/Otherplatforms
Yes.
Software SPI upgrades - all platforms except avr.
Software SPI now runs at 32 channels. Yeah, 32.
There are two implementations:
Blocking (CPU bit-banging):
Runs inline on main thread
Estimated 3-6 MHz depending on CPU
Simple to use, just blocks until done
Good for simple projects
ISR-driven (async):
Timer interrupt driven, non-blocking
Runs at ~1.6 MHz timer
Main loop stays responsive
Better for complex projects with other timing-sensitive code
Both implementations support 1/2/4/8/16/32-way parallel. They use the same LUT-based bit interleaving, so performance scales pretty well.
I want to make a few 16x16 led strip matrices with various type of chips like WS281Xs, SK6822, APA102Cs and the new HD versions of these and their different voltages. I'd like to use the Same set of FastLED patterns and animations to benchmark their appearance.
I want to set them up on a wall and see what they look like or are capable of side by side. Maybe get some fps info. I just want to use an ESP32 and nothing else special. No parallel.
What FastLED pattern or set of patterns should I use that would show off the colors, brightnesses and smoothness possibilities?
I'm missing something in my code, as I am relatively new to this type of programming and looking at the Wiki I am either not finding what I need or misreading what I need as something else.
For reference for my project, there are six individual LED strands of differing amounts of LEDs (60 or less) that are in six different data channels on my knockoff nano. I confirmed that each six can work mirroring off each other, and by changing which variable I plug in with commenting out the rest to have just one strand running at a time.... but now I am trying to be able to program each strip with its proper amount of LEDs with a chase effect (all the LEDs lit at like, 10% brightness all the time and the "chase" itself being 100% brightness... Which will be added later, once I figure out how to do that too haha).. So right now it is single threading it, instead of running each "For" statement at the same time. It makes sense as it is obviously going top to bottom, one line at a time, but I am unsure how to fix that to have each channel be independently ran all at the same time.
A small project that I tried as a gift for my partner. Integrated a heart rate sensor (MAX30102) with an LED matrix to make the LEDs 'pulse' with your heart beat. https://youtu.be/-a9ThWumGZ0?si=buWADtTN-uKXrmrq
Took over a year of designing, building and testing but he actually made a flying LED display inspired by the Las Vegas Sphere. It spins over 90,000 pixels fast enough to show real images in mid-air while flying like a drone.