Go Down

Topic: arduino mega 2560 and Glediator not working (Read 676 times) previous topic - next topic

tobi3492

Hello

i can't figure out what's wrong with my project, i have a WS2812 led strip with 300 leds.
i have connected the data pin to pin 6
the ground to ground on the arduino
and the power wires on the strip to a psu



Code: [Select]

// 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 300
#define DATA_PIN 6
#define CHIPSET WS2812
#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();
}


when i open the glediator software it can see the arduino and seems to connect to it, but when i press "open serial" the TX starts blinking on the arduino and nothing happens the leds just stay off

Grumpy_Mike

#1
Jun 13, 2018, 07:12 pm Last Edit: Jun 13, 2018, 07:14 pm by Grumpy_Mike
Problem is that Glediator is a pile of crap. There are so many configuration options that don't actually do anything or indeed work, that unless you have the near same setup as the author nothing works.

Quote
have connected the data pin to pin 6
the ground to ground on the arduino
and the power wires on the strip to a psu
But no resistor in the data line and no capacitor across the LED's supply.

tobi3492

uh okay, since glediator is a pile of crap, what program should i use then? i have tried jinx but i could not get that to work either

Delta_G

You haven't described what this project should do.  So how could anyone recommend a program to do something if you haven't told them why the something is? 

If you just want to light up leds all you need is the Arduino IDE.  No other software required. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Go Up