Go Down

Topic: MAX7219 (Read 1 time) previous topic - next topic

Kristaps071

Hello,

Few days ago I bought matrix module from Aliexpress:

http://www.aliexpress.com/item/MAX7219-Dot-Matrix-Module-For-Arduino-Microcontroller-4-In-One-Display-with-5P-Line/32620800331.html

I tried to merge it with code:

Code: [Select]


#include <HCMAX7219.h>
#include "SPI.h"
 
/* Set the LOAD (CS) digital pin number*/
#define LOAD 10
 
/* Create an instance of the library */
HCMAX7219 HCMAX7219(LOAD);
 
 
void setup()
{     
 
}
 
 
/* Main program */
void loop()
{
  byte Loopcounter;
  int Position;
 
  /* Clear the output buffer */
  HCMAX7219.Clear();
   
  /* SCROLL SOME TEXT 2 TIMES BEFORE MOVING ON */
  for (Loopcounter = 0; Loopcounter <= 2; Loopcounter++)
  {
    for(Position=0; Position <= 64; Position++)
    {
      HCMAX7219.printMatrix("SHIS IR TESTS  ", Position);
      HCMAX7219.Refresh();
      delay(80);
    }
  }
   
   
  /* SCROLL SOME INVERTED TEXT 2 TIMES BEFORE MOVING ON */
  HCMAX7219.Invert(INVERTON);
  for (Loopcounter = 0; Loopcounter <= 2; Loopcounter++)
  {
    for(Position=0; Position <= 64; Position++)
    {
      HCMAX7219.Clear();
      HCMAX7219.printMatrix("SHIS IR TESTS  ", Position);
      HCMAX7219.Refresh();
      delay(80);
    }
  }
  HCMAX7219.Invert(INVERTOFF);
   
   
   
  /* SCROLL AN INTEGER NUMBER */
  for(Position=0; Position <= 80; Position++)
  {
    HCMAX7219.Clear();
    HCMAX7219.printMatrix(-12345678, Position);
    HCMAX7219.Refresh();
    delay(80);
  }
   
   
   
  /* SCROLL AN INTEGER NUMBER WITH DECIMAL PLACE */
  for(Position=0; Position <= 96; Position++)
  {
    HCMAX7219.Clear();
    HCMAX7219.printMatrix(-12345678, 2, Position);
    HCMAX7219.Refresh();
    delay(80);
  }
   
}



For testing, but when I connect it my module this text are showing all matrix alone, it means that i have 4 matrix displays and all matrixes are showing this text not as all together.
Photo are in attachement.
Please help, where is problem?

Thank you!


ieee488

Where did you get your code?


Kristaps071

Can you suggest other Code?

marco_c

#3
May 25, 2016, 10:57 pm Last Edit: May 25, 2016, 10:57 pm by marco_c
Try the MD_MAX72XX library at the link below. Read the documentation to set the hardware type through a #define in the library. I am guessing your hardware is FC-16 type. Lots of examples come with the library.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

aarg

Yes, there is no support for chained displays in the code you showed us. Just get a decent library and don't forget to configure it for 4 displays.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Go Up