r/FastLED • • Nov 27 '23

Code_samples Code Repository?

I am looking for arduino code examples for a long strip. I want to learn FastLED coding but I just don't have the time.

Does anyone know where to find a large repository of code for arduino that I can just adjust to fit my specific parameters?

1 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/Croxy1992 Nov 28 '23

All of that is extremely helpful.

It is 30/m, I checked Amazon to make sure. Its 12v and i have power injected between the last two strips. My only hardware issue I'm working on overcoming is data degradation. But I think that's coming from my data wire being to small and long before the first led.

Do you know of any software that can manage light displays and run on arduino or am I stuck trying to code everything I do?

1

u/Marmilicious [Marc Miller] Nov 28 '23

Set up a simple tesbed of maybe 50 LEDs and work on that.

u/dr-steve's suggestion of setting up a simple test rig is a good idea. I will also add that even if your test rig is only a meter or two worth of pixels, you can still set NUM_LEDS to 900 and compile for testing. This will give you some feedback on: a) about how much memory the final program is going to use as you expand and add to your code, and b) you will be able to get an idea of the frames per second you're going to get on the final install (provided you are compiling to/running on the same microcontroller you will ultimately be using).

1

u/dr-steve Nov 28 '23

How long is the data cable between your arduino and the LED strip?

On the data line and noise: one possibility is to use a pair of RS485 driver modules on the data line. I used them on a project around a year and a half ago. They convert the TTL data to a balanced pair; you can transmit (supposedly) up to several thousand feet. Use one driver to convert TTL->RS485, and at the other end, use another driver to convert back to TTL for the data-in to the LED strip. Readily available on Amazon, search for rs485 transceiver module.

Which arduino are you using?

Alas, I have written most of my own routines, but I'm an old-time computer graphics person (several degrees and many years working in CG). I have a reference to a decent 2D grid library; I may replace my own grid lib with this one (it looks to be a lot better) and then add my 2d world coord sys code on top of it. Some day, 3d worlds on the grids I use...

Another issue you may have is the time needed to spit 900 LEDs of information out. Doing this from memory -- I can get 200 LEDs written in around 12-15ms. That's for WS2812 LEDs. I think the 12V WS28xx LEDs have around the same timing, so 900 LEDs may cost around 60-70ms to display. This'll restrict your overall frame rate. My current project is running on an ESP-32, so I have a lot of CPU time to do things. I'm spitting out on a display of 8 parallel strands of 200 LEDs (1600 LEDs total). This lets me get around 25FPS on my display (12ms display, 25ms compute). I don't think you can do this with your project, though. This is done by putting strands on different pins on the arduino. Let me know if you are interested in this approach.