How do I change the color of the LEDs in following code to RED or yellow?

#include “FastLED.h”

#define NUM_LEDS 12
#define PIN 7
CRGB leds[NUM_LEDS];

void setup() {
FastLED.addLeds<WS2812, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}
void loop() {

colorWipe(0xe9, 0xe9, 0xe9, 150);
colorWipe(0x00, 0x00, 0x00, 150);
}

void colorWipe(byte red, byte green, byte blue, int SpeedDelay){

{

for (int i = 0; i <= (NUM_LEDS/2-1); ++i) {
leds* = CRGB(red, red, red);*

  • leds[NUM_LEDS-i-1] = CRGB(red, red, red);*
  • delay(SpeedDelay);*
  • FastLED.show();*
  • }*
    }
    }

If you set your leds to the same R=G=B value, you will have some brightness of white. If you want Red, then pass in the value 255,0,0 and set your leds to the passed in R,G,B values, not all ‘red’

#include "FastLED.h"

#define NUM_LEDS 12
#define PIN 7
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}

void loop() {

  colorWipe(0xff, 0x00, 0x00, 150);
  colorWipe(0x00, 0x00, 0x00, 150);
}

void colorWipe(byte red, byte green, byte blue, int SpeedDelay) {
{
    for (int i = 0; i <= (NUM_LEDS / 2 - 1); ++i) {
      leds[NUM_LEDS - i - 1] = CRGB(red, green, blue);
      delay(SpeedDelay);
      FastLED.show();
    }
  }
}

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.... :slight_smile: