hello, i need your help. my led strip only displays white.

hello, i need your help. my led strip only displays white. what i’m doing wrong?

thanks in advance.

-version: 3.1.6
-arduino duemilanove
-SO: Windows
-code:
#include “FastLED.h”

////////////////////////////////////////////////////////////////////////////////////////////////////
//
// RGB Calibration code
//
// Use this sketch to determine what the RGB ordering for your chipset should be. Steps for setting up to use:

// * Uncomment the line in setup that corresponds to the LED chipset that you are using. (Note that they
// all explicitly specify the RGB order as RGB)
// * Define DATA_PIN to the pin that data is connected to.
// * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin
// * Compile/upload/run the sketch

// You should see six leds on. If the RGB ordering is correct, you should see 1 red led, 2 green
// leds, and 3 blue leds. If you see different colors, the count of each color tells you what the
// position for that color in the rgb orering should be. So, for example, if you see 1 Blue, and 2
// Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green).

// You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering
// and it should come out correctly, 1 red, 2 green, and 3 blue.
//
//////////////////////////////////////////////////

#define NUM_LEDS 26

// Data pin that led data will be written out over
#define DATA_PIN 6
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8

CRGB leds[NUM_LEDS];

void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(2000);

  // Uncomment one of the following lines for your leds arrangement.
  // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  // FastLED.setBrightness(CRGB(255,255,255));
  // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  //FastLED.addLeds<LPD8806, 9, 10, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

}

void loop() {
leds[0] = CRGB(255,0,0);
leds[1] = CRGB(0,255,0);
leds[2] = CRGB(0,255,0);
leds[3] = CRGB(0,0,255);
leds[4] = CRGB(0,0,255);
leds[5] = CRGB(0,0,255);
FastLED.show();
delay(1000);
}

The code looks good. Do you have a link to the LED’s you bought?
How are you wiring all this up? Have you tried a pin other than pin 6?

@Andrew_Tuline
i bought a cheap ones, at https://www.aliexpress.com/item/1m-5m-WS2812B-30-60-144-leds-m-Smartled-pixel-RGB-individually-addressable-led-strip/32807365734.html?spm=2114.search0104.3.45.c9021c60iNoOHH&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10151_10065_10344_10068_10342_10547_10325_10546_10343_10340_10548_10341_10698_10697_10696_10084_10083_10618_10307_10303_10059_10184_10534_308_100031_10103_441_10624_10623_10622_10621_10620-10620,searchweb201603_2,ppcSwitch_5&algo_expid=bd1d0722-e64f-45da-891d-f1d619e3418e-9&algo_pvid=bd1d0722-e64f-45da-891d-f1d619e3418e&priceBeautifyAB=0

and i think that the wiring is ok, 5v to 5v power supply, ground to arduino ground an power supply and din to 6 pin

They look good to me, and that code compiled (I’m using APA102’s on an Arduino Nano) and displays as expected.

And you just said that pin 6 is going to din. . .

Am wondering if you’ve got the board and port selected properly to compile and upload the code.

Also, never hurts to throw in a Serial.println(“XXX”); or whatever just to check and make sure the code you uploaded is actually running.

Maybe they aren’t actually WS2812B? Try using WS2812 or WS2811.
Or maybe Din is labeled incorrectly on the strip? Maybe try connecting your data to the other end.

@Andrew_Tuline look like it’s running, but the output is ??? instead of 6

@DEX_20 Not sure what you mean by ‘??? instead of 6’. How do you know it’s running? Like I said, I add Serial.println statements to help debug my code. See:

https://www.arduino.cc/reference/en/language/functions/communication/serial/print/

@Andrew_Tuline i write serial.println(data_pin), and it shows this “???”. and data_pin is 6.

@DEX_20 The value data_pin is not defined. On the other hand, DATA_PIN IS defined. It’s case sensitive. Furthermore, make sure you have a Serial.begin statement in your setup(), and that the baud rate matches that of your Serial monitor.

@Andrew_Tuline i change it and now it show 6, like it should. but le the led strip still white

Did you try another pin? Is the Arduino ground connected to the LED ground? All grounds should be common. Did you take it apart and put it together again? Here’s my Support Q&A:

http://tuline.com/fastled-support-qa/

@Andrew_Tuline yes, i tried several pins with no succes. all grounds are together and yes, even i tryed with another led strip. may the problem be the arduino, is a chinese copy(ch340g)?

Could be the Arduino. One thing you could do then is to put an LED/resistor combination on pin 6 and load up a blink program.

Oh, and I buy Arduino Nano’s by the 10 pack with those CH340’s. If you haven’t already done so, I’d put a Serial.println statement in your loop, so you know the loop is running.

@Andrew_Tuline it work fine, with led blinking, the only problem i have is with led strip. thanks for you help btw

Did you try setting it as a different type of strip?

@marmil yes, even changed rgb for gbr and the din for the dout

I wonder if the first pixel is damaged? You could try connecting your data line to the Din for the second pixel and bypass the first as a test.

@marmil i have done that too. with no sucess

What are you using for a power supply(s)? What voltage to you read with a multi-meter?

@marmil i’m using a pc power supply an the voltage is 5,3-5,25V