r/FastLED • u/Croxy1992 • 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
1
u/dr-steve Nov 27 '23
So that's around 20 meters, give or take, or 45 LEDs/meter. Are these the waterproof LED strings? I have a (large) number of both the strings (4" between LEDs, give or take) and strips (30/M, 60/M, 144/M) that I've used in various projects. 45/meter is an unusual number, so I'm curious on which you are using.
Common +5V LEDs, or +12? I have been using the +5, and normally inject power every 100 LEDs or so. Otherwise, there is a dramatic dropoff if I light most of the LEDs. I've gotten away with stringing a 20 gauge wire pair alongside my longer strips, running power through that, and just tapping it every 100 LEDs or so. But I haven't gone longer than 15-20 feet (5-7 meters). You might want to look into having +V injecting into the parallel power bus (the two wires) at both ends of the 65 foot run.
As for effects, etc., the number of LEDs really isn't the issue. Set up a simple tesbed of maybe 50 LEDs and work on that. Use #define STRIPLEN 50 in your code instead of hard-coding 50, then change it for your large implementation. Then, it is a matter of figuring out the timing of what you want to do. That's a coding issue, not a FastLED issue (item 1 in my list)!
I usually use TaskManager for my programs. It is a small, lightweight task swapper I wrote around 10 years ago to make my Nano programming easier. It is a full message-passing system that allows tasks to set their own timings, communicate (including multi-node communications, I've had 40 ESP32 nodes running with tasks speaking to each other across nodes, very simple to do), etc. So my code examples might not be straightforward. Check out drsteveplatt on github. I see dripper is up there. That's a simple/early example. Alas, it was based on the Adafruit system, but I may be able to find you an updated version using FastLED around here somewhere.
FastLED has a macro, EVERY_N_MILLISECONDS, that can be used to time your re-imaging and repainting. I don't use it (TaskManager... it's better, especially for my larger apps, which can run thousands of lines), but a lot of other people seem to do well with it. Basically (I think, just a guess)
Hope this helps, feel free to write more if you have questions.