Help me please :-( I have two parallel output strip on arduino due.

Help me please :frowning:
I have two parallel output strip on arduino due.
I write an effect that 5points on and 5points off and moving go on and on.from first to end of strips.when it reaches to about 50th point the frame rate goes slow and slow.how can i solve it?

Easier to answer if you post your code.

#include “FastLED.h”
#define NUM_STRIPS 2
#define NUM_LEDS_PER_STRIP 200
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];

int x;
void setup() {
//FastLED.addLeds<NEOPIXEL, 11>(leds[0], NUM_LEDS_PER_STRIP);
//FastLED.addLeds<NEOPIXEL, 22>(leds[1], NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2811, 14, RGB>(leds[0], NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2811, 22, RGB>(leds[1], NUM_LEDS_PER_STRIP);

}

void loop() {

for(int counter = 5; counter <=200; counter=counter+5) {

int step_num=counter/5;
int counter1=counter-5;

if(step_num %2 == 0){
{

for(int i = 0; i <5; i++) {
x=0;
for(int j = 0; j <=counter1; j=j+10) {
leds[x][i+j] =CRGB::Black;
leds[x+1][i+j] =CRGB::Black;
leds[x][i+j+5] = CRGB::White;
leds[x+1][i+j+5] = CRGB::White;
FastLED.show();
//delay(50);
}
}
}
}

else if(step_num %2 != 0){

for(int i = 0; i <5; i++) {
x=0;
for(int j = 0; j <=counter1; j=j+10) {
leds[x][i+j+5] =CRGB::Black;
leds[x+1][i+j+5] = CRGB::Black;
leds[x][i+j] = CRGB::White;
leds[x+1][i+j] = CRGB::White;
FastLED.show();
//delay(50);

}

i think that in top addresses of leds the ram of arduino due has been full.
i use arduino software1.8.2 , fastled 3.1.6 library , arduino due

Each strip has about 800points

@bahman_bakian Hello this is normal that your frame rate is decreasing.
first entry in the loop
counter=5;
counter 1=0;
hence for for(i…) for (j…) will run 5 times

when counter=200
counter1=195
hence for(i)for (j) runs 5*195/10=100 times
each times you have put a fast ledshow
if the double loop for (i) for (j) are made to compute the stream then put the fastled.show() after the loop
try this

void loop() {

for(int counter = 5; counter <=200; counter=counter+5) {

int step_num=counter/5;
int counter1=counter-5;

if(step_num %2 == 0){
{

for(int i = 0; i <5; i++) {
x=0;
for(int j = 0; j <=counter1; j=j+10) {
leds[x][i+j] =CRGB::Black;
leds[x+1][i+j] =CRGB::Black;
leds[x][i+j+5] = CRGB::White;
leds[x+1][i+j+5] = CRGB::White;
//FastLED.show();
//delay(50);
}
}
}
}

else if(step_num %2 != 0){

for(int i = 0; i <5; i++) {
x=0;
for(int j = 0; j <=counter1; j=j+10) {
leds[x][i+j+5] =CRGB::Black;
leds[x+1][i+j+5] = CRGB::Black;
leds[x][i+j] = CRGB::White;
leds[x+1][i+j] = CRGB::White;
//FastLED.show();
//delay(50);

}
}
}
FastLED.show();
}
}

@Yves_BAZIN thanks very very much.i undrestand my mistake.
But if i want to have fade lesds how do it.
For example :(is below code true?)

for(int hue= 0; hue<=250; hue=hue+50) {
for(int i = 0; i <5; i++) {
x=0;
for(int j = 0; j <=counter1; j=j+10) {
leds[x][i+j+5] =CRGB:(250-hue,250-hue,250-hue);
leds[x+1][i+j+5] =CRGB:(250-hue,250-hue,250-hue)
leds[x][i+j] = CRGB:(hue,hue,hue)
leds[x+1][i+j] = CRGB:(hue,hue,hue)
//FastLED.show();
//delay(50);

}
}
}
FastLED.show();
}
}
}

@bahman_bakian on that case you will only have shade of greys. 50 shades of grey to be precise :wink: . What do you wanna do exactly ?
For doing that you need to use CHSV color

@Yves_BAZIN i want to 5pixels(on) one by one.and after it 5pixels(off) one by one pixel.and this routin continue from first to end of strips.
You see the effect that 5pixels on and 5 pixels off moving through strip one pixel by one pixel.
In the 200pixels you see 20pixel on and 20pixel off after together are moving.

@Yves_BAZIN
https://profiles.google.com/photos/114067753356555134531/albums/6519908658014896961/6519908657371714162

@bahman_bakian here is some code for one strip with fade of the strip
i am using HSV colors CRGB:: Blue= CHSV(160,255,255);
the last value being could be interpreted as brightness

CRGB leds[NUM_LEDS];
int k=0
loop()
{
memmove(leds+1,leds,NUM_LEDS-1); //shift the leds
if((k/5)%2 ==1)
leds[0]=CHSV(160,255,255/(k%5+1));
else
leds[0]=CRGB::Black;

fastLED.show();
k++;
delay(10);
}

@Yves_BAZIN
https://profiles.google.com/photos/114067753356555134531/albums/6519911687920118497/6519911688186185394

@Yves_BAZIN
https://profiles.google.com/photos/114067753356555134531/albums/6519912014532511617/6519912012402204642

@bahman_bakian try the code I have post above and let me know if it does what you want

@Yves_BAZIN
https://profiles.google.com/photos/114067753356555134531/albums/6519912635140616897/6519912637521239218

I only quickly scanned that, but I’ll bet that you are referring to leds[200]. Remember, the array starts at 0 and ends at 199 for each strip.

@Yves_BAZIN ok.i’ll try it today.

@Andrew_Tuline i have 2strips. each strip has 800leds.
This is a sample code that refresh frames 39times.((200-5)/5).in each frames(step-num) if step-num was even,0th till 4th led are been black one by one fadely not suddenly.and 5th-9th led are been white and 10th-14th led are been black and this routin repeates and leds move forward one by on while 5leds are white and 5leds black.

@Yves_BAZIN i have 2strips. each strip has 800leds.
This is a sample code that refresh frames 39times.((200-5)/5).in each frames(step-num) if step-num was even,0th till 4th led are been black one by one fadely not suddenly.and 5th-9th led are been white and 10th-14th led are been black and this routin repeates and leds move forward one by on while 5leds are white and 5leds black.

@Yves_BAZIN how can i use CHSV for white color.