Can anyone tell me a little more about how fastled works with Arduino architecture? As a demo I have 2 sets of LEDs and I want them to both light at the same time (not what I really want, but just to highlight the issue). They are plugged into different outputs on the board, I'll try and attach a video. I was not expecting strip1 to fully light before strip2. I was expecting them to light at the same time. I have tried called fastled.show() at multiple places in the sketch but can make this simple operation work. What am I doing wrong?!?!?
Video here
#include "FastLED.h"
#define NUM LEDS PER STRIP 40
CRGB strip1 [NUM LEDS PER STRIP];
CRGB strip2 [NUM_LEDS_PER_STRIP];
void setup() {
FastLED.addLeds<WS2812, 10> (strip1, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812, 11> (strip2, NUM LEDS_PER_STRIP);
}
void loop() {
for (int i = 0; i < NUM LEDS PER STRIP; i++) {
stripl [i] = CRGB: : Red;
strip2 [i] = CRGB: : Green;
FastLED.show();
delay (50);
}
for (int i = 0; i < NUM LEDS PER STRIP; i++) {
stripl [i] =CRGB::Black;
strip2 [i] = CRGB::Black;
FastLED.show();
delay (50);
}
Try this.
#include "FastLED.h"
#define LEDS_STRIP 40
CRGB strip1 [ LEDS_STRIP ];
CRGB strip2 [ LEDS_STRIP ];
void setup ()
{
FastLED.addLeds < WS2812, 10 > ( strip1, LEDS_STRIP );
FastLED.addLeds < WS2812, 11 > ( strip2, LEDS_STRIP );
}
void loop ()
{
for ( byte i = 0; i < LEDS_STRIP; i ++ )
{
strip1 [ i ] = CRGB::Red;
strip2 [ i ] = CRGB::Green;
FastLED.show ();
delay (50);
}
for ( byte i = 0; i < LEDS_STRIP; i ++ )
{
strip1 [ i ] = CRGB::Black;
strip2 [ i ] = CRGB::Black;
FastLED.show ();
delay (50);
}
}
I tested on wokwi simulator and 2 strip works at the same time.
Thanks for the suggestion, I tried that too. The only difference between your sketch and mine was "byte i" Vs "int I". I still get the same output on the lights.
Now you can see why this is doing my head in!
I'm using an Elegoo Mega2560 R3
There’s no advantage to using two output pins. In this case. Handle the separate nature in software.
Put them all in one large strip object on one output pin, connect them in series, then use simple maths to do what you want:
for (int i = 0; i < 20; i++) {
strip1 [i] = CRGB::Red;
strip1 [i + 20]= CRGB::Green;
FastLED.show();
delay (50);
}
For 40 real pixels as an example.
TBH I don’t see why the code you published would make the display in the video… are you positive this is what is happening?
The number of typos in your posted code makes me suspicious… that can’t have beeen what was running, even if it kinda sorta looks like it.
a7
Thanks for the tip. I have already managed to make a strip work like in your example and it was ok for the the purposes of a demonstration.
However, I need to be able to send data to different strips of LED as they spread out in different directions and I need to avoid running a long wire form Data'out at the end of string 1 to Data'in at the start of string 2. The final product will have 12 different strings attached and I would have to rewire every device to include a D'out wire from each.
I need to be able to write instructions to multiple channels, sometimes sequentially and sometimes simultaneously in order to get the desired output. After going through all the example sketches I can't find one that will do it.
Not being a native to Arduino, can I instantiate the fastled somehow so it runs in multiple instances once per channel? Or is there an easier way in Arduino to do this?
Yes. The code above does give the effect in the video. There maybe some typos. I also tried flashko's sketch above and I got exactly the same output as in the YouTube video. It's crazy, not what I was expecting at all!!
Not only this. There are more differences.
Except for matters of style and changing a few variable names, there is no difference in what you posted to a version of the OP's code which has been fixed from the mangling that posting it incorrectly caused.
Or show us what you talking about.
@drunkasanewt please post your code using the </> tool so it doesn't get mangled.
so it looks like
for (int x = 0; x < 50; x++) {
// real code not just cut and pasted...
}
What you are asserting remains "impossible". Or very interesting. 
As I have said, if this is indeed the behaviour, the obvious fix is to make one strip and code around this odd problem.
a7
@alto777
This is the code published at the beginning.
#include "FastLED.h"
#define NUM LEDS PER STRIP 40
CRGB strip1 [NUM LEDS PER STRIP];
CRGB strip2 [NUM_LEDS_PER_STRIP];
void setup() {
FastLED.addLeds<WS2812, 10> (strip1, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812, 11> (strip2, NUM LEDS_PER_STRIP);
}
void loop() {
for (int i = 0; i < NUM LEDS PER STRIP; i++) {
stripl [i] = CRGB: : Red;
strip2 [i] = CRGB: : Green;
FastLED.show();
delay (50);
}
for (int i = 0; i < NUM LEDS PER STRIP; i++) {
stripl [i] =CRGB::Black;
strip2 [i] = CRGB::Black;
FastLED.show();
delay (50);
}
Missing function 'void loop' closing bracket.
Even adding it does not compile because it gives an error in line 2
#define NUM LEDS FOR STRIP 40
Rows (4 and 5) CRGB strip1 [NUM LEDS PER STRIP]; and CRGB strip2 [NUM_LEDS_PER_STRIP]; have a different variable name.
The same goes for lines 9 and 10.
FastLED.addLeds<WS2812, 10> (strip1, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812, 11> (strip2, NUM LEDS_PER_STRIP);
On lines 4 and 9 there is 'strip1' but on lines 15 and 22 there is 'stripl' - this is a little L, not 1.
It is strange to me that this program does anything at all. Like I said, it doesn't even compile.
In wokwi simulator my code is compiling and working as expected.
THX @flashko, I obvsly missed something in my hasty analysis and correcting to the original mangled code.
Also THX for the simulation; I cannot see why the OP’s setup could possibly produce the output claimed.
But now as ever I keep an open mind and I am looking rofward to getting to the bottom of this.
Still gonna say it’s way easier to have one strip and do the tricks in code, at least until you have so many LEDs that “showing” takes time and you can decide to “show” one strip whilst leaving the other(s) unchanged.
a7
yes, you are right. The example I gave was full of holes, that was a poor attempt by some text recognition software - but from looking, if you think in code, it would have made sense for a human to read it, just not a machine.
The point is not the grammatical/syntax errors in the OP, instead it pertains to the order in which Arduino seems to be processing commands inside a for loop when calling FastLED. There is either:- an issue with the FastLED call inside a for loop, my Elegoo hardware, or I'm missing a very important .fundamental of Arduino architecture.
Watch video. Wokwi Vs real hardware
Well it did make sense to this human, even with all the mangling.
What made us want to run it is that your claimed output did not make sense, did not do what the code clearly would… and of course the compiler brings a bit less intelligence to the game.
But is the final arbiter.
Imma go w/ @flashko and the simulator… run his exact code and tell us you still get the voodoo, then we start worrying about what sign you were born under. 
Or check your wiring &c. It’s straw clutch time.
a7
Voodoo or just Fu**ery! I feel like like I've missed something simple but fundamental. If I was using the for loop to write something out to the console it does what I expect, but with the FastLED call the code seems to be acting up. I tried it with multiple likes inside the for loop and Arduino seems to action each line in the loop completely before moving to the next line.
For example:
for (int i = 0; i < 3; i++) {
A
B
C
}
Expecting output is ABCABCABC
What I'm seeing with FastLED In the loop is AAABBBCCC
Time to pick a new hobby. 
Srsly, share your wiring.
Assure us you have the exact LED type that the library thinks.
Maybe even try a different library that works with the strip you have, Adafruit has a good one.
Go back to simple(r) examples you had nothing to do with the writing of which.
If you have hair, start pulling on it.
It should all succumb to logic.
Oh, try using one strip and maths, it’s straight head easy and guaranteed to work at least as well as what isn’t working the way you are going about it. Any conceptual desire to have two strips is completely within the power of software to afford you.
a7
found it. I was using the wrong LED type. I plugged in a real set of 2812s and it suddenly started working. Thank you for all the help, time to actually start coding the effect I'm looking for now.
@alto777
This should look the nuts when I've wired it in. I have a computer case with 9 fans, 2 GPUs and 1 CPU all with a sting of WS2812 leds in them. This sketch will randomize which device does a little wave of light, sometimes none, one, two or sometime all devices will be triggered. This was the effect I was trying to get. I will code in some input buttons to cycle though colors, speeds and modes later. But for now I'm happy. After I've wired it in, I'll post another video.
3/2 Yay! 
#include "FastLED.h"
#define LEDS_STRIP 16
#define RNDMAX 30
#define SPEED 50
CRGB strip1 [ LEDS_STRIP ];
CRGB strip2 [ LEDS_STRIP ];
CRGB strip3 [ LEDS_STRIP ];
CRGB strip4 [ LEDS_STRIP ];
CRGB strip5 [ LEDS_STRIP ];
CRGB strip6 [ LEDS_STRIP ];
CRGB strip7 [ LEDS_STRIP ];
CRGB strip8 [ LEDS_STRIP ];
CRGB strip9 [ LEDS_STRIP ];
CRGB strip10 [ LEDS_STRIP ];
CRGB strip11 [ LEDS_STRIP ];
CRGB strip12 [ LEDS_STRIP ];
void setup ()
{
FastLED.addLeds < WS2812, 23 > ( strip1, LEDS_STRIP );
FastLED.addLeds < WS2812, 24 > ( strip2, LEDS_STRIP );
FastLED.addLeds < WS2812, 25 > ( strip3, LEDS_STRIP );
FastLED.addLeds < WS2812, 26 > ( strip4, LEDS_STRIP );
FastLED.addLeds < WS2812, 27 > ( strip1, LEDS_STRIP );
FastLED.addLeds < WS2812, 28 > ( strip2, LEDS_STRIP );
FastLED.addLeds < WS2812, 29 > ( strip3, LEDS_STRIP );
FastLED.addLeds < WS2812, 30 > ( strip4, LEDS_STRIP );
FastLED.addLeds < WS2812, 31 > ( strip1, LEDS_STRIP );
FastLED.addLeds < WS2812, 32 > ( strip2, LEDS_STRIP );
FastLED.addLeds < WS2812, 33 > ( strip3, LEDS_STRIP );
FastLED.addLeds < WS2812, 34 > ( strip4, LEDS_STRIP );
}
void loop ()
{
int SEED1 = random(0,RNDMAX);
int SEED2 = random(0,RNDMAX);
int SEED3 = random(0,RNDMAX);
for ( byte i = 0; i < LEDS_STRIP; i ++ )
{
if (SEED1 == 1 || SEED2 == 1 || SEED3 ==RNDMAX) {
strip1 [ i ] = CRGB::Cyan;
}
if (SEED1 == 2 || SEED2 == 2 || SEED3 ==RNDMAX) {
strip2 [ i ] = CRGB::Cyan;
}
if (SEED1 == 3 || SEED2 == 3 || SEED3 ==RNDMAX) {
strip3 [ i ] = CRGB::Cyan;
}
if (SEED1 == 4 || SEED2 == 4 || SEED3 ==RNDMAX) {
strip4 [ i ] = CRGB::Cyan;
}
if (SEED1 == 5 || SEED2 == 5 || SEED3 ==RNDMAX) {
strip5 [ i ] = CRGB::Cyan;
}
if (SEED1 == 6 || SEED2 == 6 || SEED3 ==RNDMAX) {
strip6 [ i ] = CRGB::Cyan;
}
if (SEED1 == 7 || SEED2 == 7 || SEED3 ==RNDMAX) {
strip1 [ 7 ] = CRGB::Cyan;
}
if (SEED1 == 8 || SEED2 == 8 || SEED3 ==RNDMAX) {
strip8 [ i ] = CRGB::Cyan;
}
if (SEED1 == 9 || SEED2 == 9 || SEED3 ==RNDMAX) {
strip9 [ i ] = CRGB::Cyan;
}
if (SEED1 == 10 || SEED2 == 10 || SEED3 ==RNDMAX) {
strip10 [ i ] = CRGB::Cyan;
}
if (SEED1 == 11 || SEED2 == 11 || SEED3 ==RNDMAX) {
strip11 [ i ] = CRGB::Cyan;
}
if (SEED1 == 12 || SEED2 == 12 || SEED3 ==RNDMAX) {
strip12 [ i ] = CRGB::Cyan;
}
FastLED.show ();
delay (SPEED);
}
for ( byte i = 0; i < LEDS_STRIP; i ++ )
{
strip1 [ i ] = CRGB::Black;
strip2 [ i ] = CRGB::Black;
strip3 [ i ] = CRGB::Black;
strip4 [ i ] = CRGB::Black;
strip5 [ i ] = CRGB::Black;
strip6 [ i ] = CRGB::Black;
strip7 [ i ] = CRGB::Black;
strip8 [ i ] = CRGB::Black;
strip9 [ i ] = CRGB::Black;
strip10 [ i ] = CRGB::Black;
strip11 [ i ] = CRGB::Black;
strip12 [ i ] = CRGB::Black;
FastLED.show ();
delay (SPEED);
}
}