Arduino Code for SKU: CE09639 (4x4 LED Matrix)

Hi,

I’m trying to get the 4x4 LED matrix working with FastLED on Arduino. Blink doesn’t seem to do anything. Wondering if anyone can help. Basically I want all 16 lights on - nothing complicated.

In the meantime, I’ll keep trying myself

Many thanks

Pete…

2 Likes

Hi @Pete35523
Welcome back :wave:

Here is a stripped down version of blink.ino with all the open params set to your part.
I don’t have this specific component so I can’t test it for you but I think this will play dice.
Give it a shot and let me know. :slight_smile:

#include <FastLED.h>

// How many leds in your strip?
#define NUM_LEDS 16
#define DATA_PIN 3

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() { 
  /* FastLED calls a function that doubles as a constructor for a c++ 17 template
   (which it keeps internally in a struct). Yuck! 
   It takes a protocol, a datapin, and a byte order which in your case is GRB */
  FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
  for (int i = 0; i < NUM_LEDS; i++) {
    // We can write to our array of leds :)
    leds[i] = CRGB::White;
    delay(500);
    /* Call this abstracted void function 
    to punch out the bytes down the DATAPIN.*/
    FastLED.show();
  }
}

void loop() {}

Pix :heavy_heart_exclamation:

1 Like

If you mean this I can help, except I used the aidafruit neopixels library:

2 Likes