Pages: 1 ... 18 19 [20]   Go Down
Author Topic: Scrolling LED matrix display - Parola for Arduino  (Read 41303 times)
0 Members and 1 Guest are viewing this topic.
Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1255
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@confusered

It took a while but the answer is obvious (finally!). The pins you are selecting for the creation of the Parola object are the same pins that are defined for native-SPI hardware control. If you use the type of constructor you did, it defaults to non-native control (using these same pins). SDFat uses the same pins but with hardware controls. This overrides the non-native SPI and a mess results for the display.

Changing the constructor so that only the CS pin is defined works. This is the code that works on my system. I have left all the debug code in and you will see it has a slightly different structure. I believe that the implementation of String is buggy, so it is best to avoid it.

Code:
#include <MemoryFree.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>

#define  USE_SDFAT  1

#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 12
#define CS_PIN 10

// Generic output pins
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

#define SPEED_TIME 25
#define PAUSE_TIME 2000

char newstring[10] = "1234";
char datastring[10]  = "abcd";

#if  USE_SDFAT
#include <SdFat.h>
SdFat sd;

const int chipSelect = 4;
long index = 0;
#endif

void setup(void)
{
#if  USE_SDFAT
  sd.begin(chipSelect, SPI_FULL_SPEED);
#endif

  P.begin();    //starts parola
//  P.displayScroll(datastring, LEFT, SCROLL_LEFT, SPEED_TIME);
  P.displayText(datastring, CENTER, SPEED_TIME, PAUSE_TIME, SCROLL_LEFT, SCROLL_LEFT);

  Serial.begin(57600);
  Serial.println(F("[SDwithParola]"));
  Serial.print(F("freeMemory()="));
  Serial.println(freeMemory());
}

void loop(void)
{
  if (P.displayAnimate()) // animates and returns true when an animation is completed
  {
    getword();
    strcpy(datastring, newstring);
    Serial.print(F("datastring = "));
    Serial.println(datastring);
    Serial.println();
    P.displayReset();
  }
}

void getword()
{
#if  USE_SDFAT
  SdFile myFile;
  long index;
  
  if (!myFile.open("WORDS.TXT", O_READ))  //Open the file for reading
  {
    strcpy(newstring, "Error");
  }
  else
  {
    index = random(100) * 4;   // offset of a random number from 0 to the word count
    Serial.println(index);
    myFile.seekSet(index);      // go to position
    myFile.read(newstring, 4);  // read the word
    newstring[4] = '\0';
  }

  Serial.print(F("newstring  = "));
  Serial.println(newstring);  // Print the string to serial
  myFile.close();
#endif
}
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, everyone  ...Marco  if you don't mind  i would like to help nikomaz  .

@nikomaz  
Open the MD_MAX72xx folder and then open MD_MAX72xx.h (use notepad)  scroll down to the lines where i'm going to show you in my attachment and change the 0 to 1 at the bottom and 1 to 0 at the top  if I'm getting you confused just copy from my file. then save file and exit.
I'm assuming you have a setup similar to the ICStation boards (the one with SMD chip on the back and use jumpers to attach them together) you probably wired your matrix leds the same way if not use the generic hardware switch which is in the same file but you have to change the upper and lower lines to 0 and the middle to 1,  Hope it works.
 if not post a schematic of your Matrix.

after you done run the Parola examples you may  have to flip the whole display 180.  if your wires on the left side.

Yeap, i know that, I already change that values trying the 3 boards. But only Gereric works but in 90°, ICStation and Parola didn't show anything.


Hola nikomaz!

The orientation of the matrix can be adjusted in the software, but you need to do it in the MD_MAX72xx library. What to do is described in the documentation for the library. You will need to set some compile time switches to make it work - afsaisi has already told you a bit but exactly what you need to do will depend on how your matrix is wired up.

What values do I change? In documentation cant find something about it, only found the modules, but only generic works. So i need to change rows for colums i think. The matrix display is wired anodes in colums to SEG and cathodes in rows to DIG.

I can change the wires DIG and SEG but cant modify the display wired. (anodes colums, cathodes rows)
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1255
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look in the _lib header file. Each of the specifics is converted to a series of other transformations.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: 1 ... 18 19 [20]   Go Up
Jump to: