At the very begining of my project (a circle of 286 WS2812B leds with

At the very begining of my project (a circle of 286 WS2812B leds with an external DMX controls of general color, chaser color, speed and chaser lenght), this is my first sketch:

#include “FastLED.h”

// How many leds in your strip?
#define NUM_LEDS 286
#define DATA_PIN 6
#define BRIGHTNESS 64
CRGB leds[NUM_LEDS];

unsigned int atrain = 0; //startindex
unsigned int ltrain = 20; //lenght
unsigned int btrain = 20; //endindex
boolean Cchange = true; //newvalues for general colors or train colors

void setup() {
//Serial.begin(9600);
delay (3000);
FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );

}

void loop()
{
if (Cchange == 1) {
gnrl ();
clrtrain();
}

Cchange = false;
chaser();
FastLED.show();
atrain = atrain + 1;
btrain = btrain + 1;
//FastLED.delay(10);
}

void gnrl()
{
fill_solid( &(leds[0]), NUM_LEDS, CRGB( 0, 0, 255) );//All color
}
void clrtrain()
{
fill_solid( &(leds[atrain]), ltrain, CRGB( 255, 200, 200) );//Train color
}

void chaser()
{
if (atrain <= 285)
{ leds[atrain].setRGB( 0, 0, 255);
}
else
{
atrain = 0 ;
leds[atrain].setRGB( 0, 0, 255);
}

if (btrain <= 285)
{ leds[btrain].setRGB( 255, 200, 200);
}
else
{
btrain = 0;
leds[btrain].setRGB( 255, 200, 200);
}
}

I use Fastled 3.1.3, Arduino Duemilanove, Arduino IDE 1.6.12 on OSX.
Why is this simple sketch so slow?
Do i have to use APA102 leds or is it a code problem?

What speed are you aiming for? This is giving about 80 frames per second. That’s somewhat near the limits for WS2812B.

Ok, thank you. I haven’t found this information on the wiki.
So i’m gone change my code to go faster (increment two or three leds per frame , according to needed speed) That’s juste because my “led train” needs to be very slow or very fast (external control) and this without visible steps between two speed values.
Do you know the approximative ratio between fps and number of led for WS2812B with arduino?

@Cedric_Cambon For the theoretical maximum fps:
One LED’s data takes supposedly 30 microseconds, and then you need to wait at least 50 microseconds for the data to latch. For 286 LEDs, it would take 8580 + 50 = 8630 microseconds. One second = 1000000 microseconds, so 1000000/8630 = fps = 115.
However, to do this you’d need to be spending 100% of your processing time writing out LED data, which is not really useful for anything.
A really rough estimate for this type of sketch is 25% of the time doing calculations, giving 75% time writing out, so 115*0.75 = 86 fps maximum.
The amount of time it takes to do the rest of your code is probably not bound to any particular timing besides CPU speed, so a faster board increases the amount of time you can spend writing out the data, up towards that 115fps theoretical maximum.
Something you can do if you need anything faster than this, is to use a Teensy, which allows parallel output - writing data out to multiple strips at the same time. You would split your ring into several shorter sections, for example it looks like you could fairly easily do it in two sections of 143 each. This almost doubles your theoretical maximum, actually to 230fps. The same logic about code speed applies as before.
If you read all of that, I applaud you.

Looks like a gate for fpv racing.

Thank you Techy - Chiptunes & Stuff . Now i’ve got everything i need to choose my hardware.
To David Johnson, it’s a ring to make lighting effects on the face of a comedian or musician. On the other side leds are hidden and we just see the light moving on face…