user8162: How can I only let half of the LEDs light up,
for example, LED 1 on, LED 2 off, LED 3 on...and so on.
I did it this way
(this example fades also all LEDs on and off)
   int x = 1;
   for (int i = 0; i > -1; i = i + x){
      leds[0] = CRGB(i,0,0);
      leds[1] = CRGB(0,i,0);
      leds[2] = CRGB(i,0,0);
      leds[3] = CRGB(0,i,0);
      Serial.println(i);
      FastLED.show();
      if (i >= 55) x = -1;             // switch direction at peak
      delay(10);
   }

but that is not so nice if you have 100 LEDs or so.

user-1: int x = 1;
   for (int i = 0; i > -1; i = i + x){
     // using modulo
     if(i % 2 == 0){
     leds[i] = CRGB(i,0,0)}else{
     leds[i] = CRGB(0,i,0);}

      Serial.println(i);
      FastLED.show();
      if (i >= 55) x = -1;             // switch direction at peak
      delay(10);
   }

or 
int x = 2;
   for (int i = 0; i > -1; i = i + x){
     leds[i] = CRGB(i,0,0);

      Serial.println(i);
      FastLED.show();
      if (i >= 55) x = -2;             // switch direction at peak
      delay(10);
   }


user3386: I don't know much about neopixel but as a general coding practice if you want to do something for every other object, you use the modulus operator like so
if(i % 2 == 0)
{
  //i is even
  //off
}
else
{
  //i is odd
  //on
}

So just wrap your current for loop in another one and to the above with the iterating variable.

8162: <p>How can I only let half of the LEDs light up,
for example, LED 1 on, LED 2 off, LED 3 on...and so on.</p>

<p>I did it this way
(this example fades also all LEDs on and off)</p>

<pre class="lang-c prettyprint-override"><code>   int x = 1;
   for (int i = 0; i &gt; -1; i = i + x){
      leds[0] = CRGB(i,0,0);
      leds[1] = CRGB(0,i,0);
      leds[2] = CRGB(i,0,0);
      leds[3] = CRGB(0,i,0);
      Serial.println(i);
      FastLED.show();
      if (i &gt;= 55) x = -1;             // switch direction at peak
      delay(10);
   }
</code></pre>

<p>but that is not so nice if you have 100 LEDs or so.</p>
 -1: <pre><code>int x = 1;
   for (int i = 0; i &gt; -1; i = i + x){
     // using modulo
     if(i % 2 == 0){
     leds[i] = CRGB(i,0,0)}else{
     leds[i] = CRGB(0,i,0);}

      Serial.println(i);
      FastLED.show();
      if (i &gt;= 55) x = -1;             // switch direction at peak
      delay(10);
   }
</code></pre>

<p>or </p>

<pre><code>int x = 2;
   for (int i = 0; i &gt; -1; i = i + x){
     leds[i] = CRGB(i,0,0);

      Serial.println(i);
      FastLED.show();
      if (i &gt;= 55) x = -2;             // switch direction at peak
      delay(10);
   }
</code></pre>
 3386: <p>I don't know much about neopixel but as a general coding practice if you want to do something for every other object, you use the modulus operator like so</p>

<pre><code>if(i % 2 == 0)
{
  //i is even
  //off
}
else
{
  //i is odd
  //on
}
</code></pre>

<p>So just wrap your current for loop in another one and to the above with the iterating variable.</p>
