I need a sketch that will read and display Jinx! .dat files from a Teensy 3.6 SDcard

I have an array of 5ea. 32X8 NeoPixel Panels connected to a teensy 3.6 with a OctoWS2811 card.
I can display Jinx generated animations, including scrolling text on the array with Glediator.ino.

I saved a "myanim.dat" file to an SD card but I can not properly read, then display the contents on the array.

With the sketch in https://hackaday.io/project/5714-glediator-from-sdcard-arduino/details (modified for NUM_LEDS and SD pin) I get an indication of a good read/display but it was only on a portion of the 1st panel. The sketch does not include OctoWS2811.

Any help will be much appreciated.

Thank you.
 
We can probably help you get this running, but you have to do more. At the very least, you must post the full code you tried (even if only a slight change) and details of how your LEDs are wired. Photos are best.
 
Use these buttons...

sc.png

To check, click "Go Advanced" or "Preview Post" to see how your message will appear.
 
On my iMac the pjrc forum formatting menu doesn't show. I'm now on my PC.

I was using this code to read and display a Jinx! generated 'myanim.dat' file on my 5 panel 32X8 neopixel array.

Code:
// Glediator Arduino UNO sketch by Jens Andrée
// 500k bauds with 80 pixels no problem
// sdcard stream for stand-alone operation.

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

#define NUM_LEDS 1280
#define DATA_PIN 2
#define CLOCK_PIN 3
#define CMD_NEW_DATA 1
#define BAUD_RATE 100000  //if using Glediator via serial

File fxdata;
CRGB leds[NUM_LEDS];

void setup()
{
  FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS); //se doc for different LED strips
//  Serial.begin(BAUD_RATE); // when using Glediator via usb
  Serial.begin(115200);
  
  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(BUILTIN_SDCARD))
  {
    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()
{

// uncomment for Glediator  
//  while (fileGlediator () != CMD_NEW_DATA) {}
//  Serial.readBytes((char*)leds, NUM_LEDS*3);

  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(20); // 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 tried to 'Insert Image' of the display showing proper scrolling of "Jinx!" with Glediator.ino and the display I get with the above code - but - I got this with both pictures:
Capture.PNG
I'll try again later with the Insert Image of my array.
 
This video shows the proper operation of the 5 32X8 neopixel panel array..


This is how the code in post #5 displayed the Jinx! generated myanim.dat file from the SD Card.


Thanks for your attention.
 
Is there any additional information I need to supply to get help with the sketch?
I think the first video shows that the 8X32 panels were wired properly.
 
Are there any tutorials or step-by-step instructions for using Jinx, and specifically how to get it to export these .DAT files?

Is there any documentation about the .DAT file data format?

I have personally never used Jinx, and honestly I just don't have time to get into it, if I were to look at this application. I would like to create an example for the OctoWS2811 library, if I could do this pretty quickly. But such an example would not be very useful (and perhaps create more questions than it helps anyone) if there isn't good info for others about how to get the .DAT file created.
 
For the Jinx! User Manual (Version 2.4) go to http://www.live-leds.de/downloads/

This user manual is not enough. You didn't even manage to say which page number to read!

I will *not* invest engineering time into writing a .DAT file player if this manual (and it's info on page 24) is all that is available to new users. There must be a step-by-step tutorial of some sort (screenshots or video). There must also be clear documentation. The manual says "Glediator2 / Solderlab UIB compatible recording files", but there is no link to documentation about this format.
 
Paul,

The info needed to create the .dat file is on page 22 Add and Edit Output Devices.

"The Data section will give you control over protocol specific options and
includes the number of channels as well as the block size for some protocols.
The next section will configure the serial port and the baud rate if it is a serial
or usb (e.g. FTDI) based device and the last section will let you redirect the
protocol output into a file. This would be useful to create animation files,
which you can play on a standalone controller. After selecting the Redirect
Output to File option you have to choose the file to record into with the select
button. Recording starts on activating output and stops on closing output. "

Here is a myanim.dat file:
 

Attachments

  • myanim.zip
    36 KB · Views: 328
Well if you have a big file filled with normal glediator data, just edit the example to read the file instead of getting it from the serial port. Same code, but instead of Serial.read() use myfile.read().
 
I'm going to try to help you with some code to get you started. But in doing so, I want to be clear that I do not intend to do your project for you. If this doesn't work, you will need to figure out how to adapt it. This is meant to help you, but I'm not going to do more than this. Ok?

Here goes...

Code:
// Glediator example with OctoWS2811, by mortonkopf
//
// https://forum.pjrc.com/threads/33012-Gladiator-with-OctoWS2811-working-example

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

const int ledsPerStrip = 34;
const int NUM_LEDS = 272;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

File myfile;

// Use these for the SD+Wiz820 or other adaptors
//#define SDCARD_CS_PIN    4
//#define SDCARD_MOSI_PIN  11
//#define SDCARD_SCK_PIN   13

// Use these with the Teensy 3.5 & 3.6 SD card
#define SDCARD_CS_PIN    BUILTIN_SDCARD
#define SDCARD_MOSI_PIN  11  // not actually used
#define SDCARD_SCK_PIN   13  // not actually used

// Use these with the Teensy Audio Shield
//#define SDCARD_CS_PIN    10
//#define SDCARD_MOSI_PIN  7
//#define SDCARD_SCK_PIN   14

void setup() {
  leds.begin();
  leds.show();
  SPI.setMOSI(SDCARD_MOSI_PIN);
  SPI.setSCK(SDCARD_SCK_PIN);
  if (!(SD.begin(SDCARD_CS_PIN))) {
    // stop here, but print a message repetitively
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
}

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

int fileGlediator() {
  return myfile.read();
}

void loop() {
  byte r,g,b;
  int i;

  if (!myfile) {
    // need to open the file
    myfile = SD.open("myanim.dat");
    if (!myfile) {
      Serial.println("could not open the file!  :(");
      delay(500);
      return;
    }
  }
  while (fileGlediator() != 1) {}

  for (i=0; i < NUM_LEDS; i++) {
    b = fileGlediator();
    r = fileGlediator();
    g = fileGlediator();

    leds.setPixel(i, Color(r,g,b));
  }
  leds.show();
}

/* Helper functions */
// Create a 24 bit color value from R,G,B
unsigned int Color(byte r, byte g, byte b)
{
  return (((unsigned int)b << 16) | ((unsigned int)r << 8) | (unsigned int)g);
}
 
Paul,

The code works great! I changed ledsPerStrip = 256; and NUM_LEDS = 1280; (for my panels).
To manage the display speed I added delay(20); after leds.show();

Again, thanks very much.
 
and what do i have to do if i want this for my ws2812b. i know the library OctoWS2811 is only for 2811 .. i tryed some lines from this code: this code works very fine with my teensy 3.6 and connected to com-port

Code:
#include "FastLED.h"
#define NUM_LEDS 144
const int dataline = 6;

CRGB leds[NUM_LEDS];
void setup() {
        Serial.begin(115200); 
     LEDS.addLeds<WS2812B, dataline>(leds, NUM_LEDS);
}
int serialGlediator() {
  while (!Serial.available()) {}
  return Serial.read();
}
void loop() {
   while (serialGlediator() != 1) {} 

   for (int i=0; i < NUM_LEDS; i++) { 
     leds[i].b = serialGlediator();
     leds[i].r = serialGlediator();
     leds[i].g = serialGlediator();

   }
     FastSPI_LED.show();
}

i tryed to implement the SD-card commands but they didnt work :( .. Please could someone help me with this problem
 
and what do i have to do if i want this for my ws2812b. i know the library OctoWS2811 is only for 2811 .. i tryed some lines from this code: this code works very fine with my teensy 3.6 and connected to com-port

Code:
#include "FastLED.h"
#define NUM_LEDS 144
const int dataline = 6;

CRGB leds[NUM_LEDS];
void setup() {
        Serial.begin(115200); 
     LEDS.addLeds<WS2812B, dataline>(leds, NUM_LEDS);
}
int serialGlediator() {
  while (!Serial.available()) {}
  return Serial.read();
}
void loop() {
   while (serialGlediator() != 1) {} 

   for (int i=0; i < NUM_LEDS; i++) { 
     leds[i].b = serialGlediator();
     leds[i].r = serialGlediator();
     leds[i].g = serialGlediator();

   }
     FastSPI_LED.show();
}

i tryed to implement the SD-card commands but they didnt work :( .. Please could someone help me with this problem

The octows2811 works for the 2812b as well. As for the code to use the SD, did you make sure to use the fileGlediator etc rather than serial? I just read this as I'm also looking for answers to various questions in regards to using teensy with ws2812 leds in both the capacity of artnet and also running off an sd card. (The next bit for the SD card is to have multiple animation files on the card and a way to switch between them with a number pad)
 
Has anyone done a version of this sketch in which you cycle through multiple files on the SD card? If my understanding is correct, currently you can only point it to a singular file and is based on that file's name.
 
Back
Top