Hi guys, newbie here and i need some help.

Hi guys, newbie here and i need some help. I just bought this item (WS2812 8x8 rgb led matrix) from aliexpress and I can’t seem to make it work properly.

I tried the tutorial from fastled website but I can only make the first led blink.
im trying to power it using an 1850 battery and an LM2596 buck converter at 5v.

am i missing something? do i need to put some extra codes or something or is the current flow too low? the LM2596 is supposed to give out 3A.

any help would be appreciated!
https://www.aliexpress.com/item/WS2812-LED-5050-RGB-8x8-64-LED-Matrix-for-Arduino/32600043941.html

Could you share the code on gist ?

Which controller are you using?

im using an arduino uno.

heres my current code, also I put red but it blinks green. im lost.

[#include <FastLED.h>
#define NUM_LEDS 64
#define DATA_PIN 6

CRGB leds[NUM_LEDS];
int i = 0;

void setup() {
FastLED.addLeds<WS2812, DATA_PIN>(leds, NUM_LEDS);
}

void loop() {
leds[i] = CRGB::Red;
FastLED.show();
delay(500);

leds[i] = CRGB::Black;
FastLED.show();
delay(500);
i++;

if(i==63) i=0;
}]

@Jaja1 try this
Add #define FASTLED_ALLOW_INTERRUPTS 0
Before the #include ‘fastled.h’
Also in the addleds<ws2812,data_pin,GRB>(leds,NUM_LEDS);

still doesn’t work bro, the 2nd led only blinks red once then nothing

@Jaja1 is the ground of the arduino plugged with the ground of your power supply ? If yes
Try this in your code reduce the NUM_LEDS to 5 and power the leds using the arduino pins.
The 2812 should work even with a lower voltage
Stupid question are you connecting to the GPIO 6 and not the 6th PIN ?

yes, after the LM2596 converts the voltage to 5v, i connect its ground to both the arduino and the led matrix.

There is no real ‘loop’ to sequence through your leds in your code.

You need a line like…

for (int i = 0; i < NUM_LEDS; i++) {

  // here you do your stuff

}

Just noticed the i++; statement but still… I think that loop() re-initialises the variables each time it gets executed and therefore always sets i = 0 !!

Jaja, if you want to light up multiple LED’s, then your code is incorrect as you have no loop.

Please start out with the various examples included with FastLED instead of what you have provided.

Please also include links when referring to any online tutorials you have tried.

this is the tutorial i have followed, the fastled website brought me here.

can you suggest a better tutorial?

Try the examples included with FastLED at:

Just change the definitions to match your pins and LED’s.

@Jaja1 Did you try any of the FastLED examples?

Try out the FirstLight one.

Even though Jaja’s code above isn’t exactly what we’re use to seeing, it SHOULD work. (The code worked for me when I tested it.)

Also, Jaja, when sharing code please put it on http://gist.github.com and share the link. This way it will always be formatted correctly on all devices and line numbers can be referenced for discussion.

Use this sketch to work out the correct colour order for your leds…

@JP_Roy i is a global variable so it does not get reset each time through the main loop.

Some of the matrix boards have a mistake on the silkscreen, Data In and Data out are reversed. Try connecting your controller to the data out pin.

@Jaja1 - Here is my test new products sketch located at:

I use it to test any new RGB Led products that I purchase. All you have to do is change line 9 to 64, upload it to your Uno and run it.

@JP_Roy actually no :wink: i keeps on getting increase. The loop doesn’t reset the variables. @Jaja1 code is correct.

@Yves_BAZIN I have to admit I did not even try the code and only offered a wild guess. I just remembered something about static variables and incorrectly applied the meaning in this context.