Arduino with WS2811, one string to Vixen no lights

I am using the code below, but when I play my few effects on Vixen, no lights light up on my WS2811 string. I am using Arduino Uno connected to pin 6.
The issues I have been dealing with are making sure my baud and serial are the same number: 57600. Putting the header >>050<< in Vixen. Making sure RGB is the same in the code and Vixen. Connecting Vixen first and then connecting Arduino. Making sure the RX button is flashing on Arduino. The Effect Preview in Vixen is on.
The Arduino can run all the canned FastLED programs correctly, so I assume I am doing something wrong in connecting the Arduino and Vixen. I have tried to run the program using only the USB connection to power the WS2811 string, and I have tried it by plugging in an AC/DC adapter 9V, 1500mA into the power jack of the Arduino.
I would greatly appreciate any help. I am undoubtedly missing something basic.

/*
Vixen to Arduino based Generic Serial interface for Addressable Pixels
*/

#include <FastLED.h>
#define NUM_LEDS 050
#define DATA_PIN 6
#define LED_TYPE WS2811
#define COLOR_ORDER GRB

CRGB leds[NUM_LEDS];

void setup() {
  delay(3000);
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  

  
  FastLED.clear();
  Serial.begin(57600);
}

void loop() {
  int cnt;
  unsigned int num_leds;
  unsigned int d1, d2, d3;

for(;;) {
    cnt = 0;
    //wait for vixen header
    while(!Serial.available());
      if(Serial.read() != '>') {
        continue;
        }
    //second char of header
    while(!Serial.available());
      if(Serial.read() != '>') {
        continue;
        }
    //first digit for the number of pixels
    while(!Serial.available());
      d1 = Serial.read();
    
    //second digit for the number of pixels
    while(!Serial.available());
      d2 = Serial.read();
    
    //third digit for the number of pixels
    while(!Serial.available());
      d3 = Serial.read();
    
    //read til end of the header
    while(!Serial.available());
      if(Serial.read() != '<') {
        continue;
        }
        
    while(!Serial.available());
      if(Serial.read() != '<') {
        continue;
        }
    
    // calculate number of pixels from the characters provided in the header digits
    num_leds = (d1-'0')*100 + (d2-'0')*10 + (d3-'0');
    // if requested number of pixels exceeds connected pixels, ignore.
    if(num_leds > NUM_LEDS) {
      continue;
      }
    
    do {
      while(!Serial.available());
        leds[cnt].r = Serial.read();
      while(!Serial.available());
        leds[cnt].g = Serial.read();
      while(!Serial.available());
        leds[cnt++].b = Serial.read();
      } 
    while(--num_leds);
    FastLED.show();
    }
}

The 'continue' keyword jumps out of an iterative statement. An 'if' statement has no iteration. So it does absolutely nothing.

Thank you so much for your help. Could you tell me what I should do to fix the program? My goal for this program is to have my middle school STEM students work with Vixen to have a string of pixels blink with a song.

Not solving the problem

How may LEDs is that? 40 or 50?

It is 50. I read somewhere that I needed 3 digits everywhere.

You don't need 3 digits everywhere in code; the leading zero indicates that it's an octal representation.

Block the site where you did read that :slight_smile:

Thank you, thank you, thank you!!! I am so happy. I have spent hours tweaking this program and the Vixen settings and all I needed was to take out the third digit. My program is now this:

/*
Vixen to Arduino based Generic Serial interface for Addressable Pixels
*/

#include <FastLED.h>
#define NUM_LEDS 50
#define DATA_PIN 6
#define LED_TYPE WS2811
#define COLOR_ORDER GRB

CRGB leds[NUM_LEDS];

void setup() {
  delay(3000);
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  

  
  FastLED.clear();
  Serial.begin(57600);
}

void loop() {
  int cnt;
  unsigned int num_leds;
  unsigned int d1, d2;

for(;;) {
    cnt = 0;
    //wait for vixen header
    while(!Serial.available());
      if(Serial.read() != '>') {
        continue;
        }
    //second char of header
    while(!Serial.available());
      if(Serial.read() != '>') {
        continue;
        }
    //first digit for the number of pixels
    while(!Serial.available());
      d1 = Serial.read();
    
    //second digit for the number of pixels
    while(!Serial.available());
      d2 = Serial.read();
    
    
    //read til end of the header
    while(!Serial.available());
      if(Serial.read() != '<') {
        continue;
        }
        
    while(!Serial.available());
      if(Serial.read() != '<') {
        continue;
        }
    
    // calculate number of pixels from the characters provided in the header digits
    num_leds = (d1-'0')*10 + (d2-'0');
    // if requested number of pixels exceeds connected pixels, ignore.
    if(num_leds > NUM_LEDS) {
      continue;
      }
    
    do {
      while(!Serial.available());
        leds[cnt].r = Serial.read();
      while(!Serial.available());
        leds[cnt].g = Serial.read();
      while(!Serial.available());
        leds[cnt++].b = Serial.read();
      } 
    while(--num_leds);
    FastLED.show();
    }
}