Hello experts, total noob here and i am not having much success getting glediator/jinx

Hello experts,

total noob here and i am not having much success getting glediator/jinx to work from an SD card. I am using ardunio pro mini plus SD shield with the following connections pin 10 = CS, Pin 11 = mosi, pin 12 = miso, pin 13 = SDK. This works when writing test files to the SD card following this guide Arduino Tutorial: SD card module Micro SD tutorial DIY. - YouTube. When i use this sketch GLEDIATOR_with_SD_Card_WS2811_for_Arduino_Nano @ http://hamburgtech.de/downloads/ my LEDs do not animate but only turn on.

Anyone have success with GLediadtor/jinx using an SD card?

I think my problem is this line from the sketch

#define CMD_NEW_DATA 1

because i am not sure what pin 1 should connect to nor does the pro mini have a pin 1. i’ve gathered that it might be RXI on the pro mini.

PS: I’ll buy anyone who can help me a 6-pack of their favorite beer.

Here is a picture of the two sd shields i bought along with the pro mini:

Here is sketch

// Glediator Arduino UNO sketch by Jens Andrée / https://politisktinkorrektpappa.wordpress.com/
// 500k bauds with 80 pixels no problem
// sdcard stream for stand-alone operation.
// changed to WS2811 chip and a few small changes by Nils Gregersen / http://hamburgtech.de/

#include <FastLED.h>
#include <SPI.h>
#include <SD.h>

#define NUM_LEDS 256
#define DATA_PIN 3
#define CHIPSET WS2812B
#define CMD_NEW_DATA 1
#define BAUD_RATE 115200

File fxdata;
CRGB leds[NUM_LEDS];

void setup()
{
FastLED.addLeds<CHIPSET, DATA_PIN>(leds, NUM_LEDS); //see doc for different LED strips
Serial.begin(BAUD_RATE);

for(int y = 0 ; y < NUM_LEDS ; y++)
{
leds[y] = CRGB::Black; // set all leds to black during setup
}
FastLED.show();

pinMode(10, OUTPUT); // CS/SS pin as output for SD library to work.
digitalWrite(10, HIGH); // workaround for sdcard failed error…

if (!SD.begin(10))
{
Serial.println(“sdcard initialization failed!”);
return;
}
Serial.println(“sdcard initialization done.”);

// test file open
fxdata = SD.open(“myanim.dat”); // read only
if (fxdata)
{
Serial.println(“file open ok”);
fxdata.close();
}
}

int serialGlediator ()
{
while (!Serial.available()) {}
return Serial.read();
}

void loop()
{

fxdata = SD.open(“myanim.dat”); // read only
if (fxdata)
{
Serial.println(“file open ok”);
}

while (fxdata.available())
{
fxdata.readBytes((char*)leds, NUM_LEDS*3);
FastLED.show();
delay(50); // set the speed of the animation. 20 is appx ~ 500k bauds
}

// close the file in order to prevent hanging IO or similar throughout time
fxdata.close();
}

I don’t believe
#define CMD_NEW_DATA 1
is for a pin. It’s just a defined variable set equal to 1.
It’s also not being used anywhere in the code you’ve posted. It is found in a few of the other .ino programs linked on the http://hamburgtech.de/downloads page though:

void loop() {
while (serialGlediator () != CMD_NEW_DATA) {}
Serial.readBytes((char*)leds, NUM_LEDS*3);
FastLED.show();
}

Which means “if there is serial data and it’s Not equal to 1, then read the data and show it.”
Don’t know if that helps you any though.

Thanks for clarifying CMD_NEW_DATA. i’ll circle back and check all my connections. Also maybe have a setting wrong in glediator. :frowning:

@G_Sizz I tried out Glediator and got it to work over serial, but don’t have an SD card setup at the moment so can not test further. I’m guessing that you previously tested directly with Glediator without using an SD card to at least verify things were setup and working to that point?

@marmil Correct i got it working over serial however i am trying to build some wearable pieces hence the need to use an SD card.

I seemed to be unblocked. Not sure why at this point. I decided to reinforce all my connections and try fewer LEDS and things started working. I am powering through my laptop so i was surprised that it may be a power issue. I may circle back if i can’t get all LEDs functioning since its a premade matrix.

Cool, so you have it reading/displaying saved pixel data from a SD card now? How many LEDs did you reduce it to in order to get it to work? To be clear, did you physically reduce the number of pixels or just specify a lower number in code?

Typically I think computer USB ports are only designed to provide 500mA. That’s not much.

Yes I am able to read/display pixel data from the SD card. I reduced the LEDS to via by lowering the number in the code as well as in Glediator. I decided to try 16 at first and worked my way up to 64 before calling it a night. Thanks for the USB port/power tip i’ll consider that moving forward.

Thank you for the info.

If you decide to power the matrix with an external power source (plugged in or battery) remember that there needs to be a ground connection between the LEDs and the microcontroller.