Go Down

Topic: Max72xxPanel - Interface for Adafruit GFX for MAX7219 (Read 15663 times) previous topic - next topic

Docedison

Just rotate the character set 90 Deg... and turn it (the display) on end...
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

markruys


I'm trying to use the code with two matrix modules but i don't understand how.


I've just commited some changes to support multiple vertically connected displays. Any set of matrices in the form of a rectangular should work now. Connect them in cascade, starting from the upper left to the bottom right:
    1 2
    3 4
    5 6
Please give it a try, as I have only a single display and can't test the modifications for multiple displays myself.

alessiocavalieri

SPI, works fine, but some tuning in cascade is required, my test downloadable as movie + readme:

https://www.dropbox.com/sh/3zx1m6vshfvir4g/k5qnJVpXAo?m

alessiocavalieri

#18
May 21, 2013, 05:53 pm Last Edit: May 21, 2013, 05:58 pm by alessiocavalieri Reason: 1
I have tested this library:

http://forum.arduino.cc/index.php?topic=144872.0

https://github.com/mjkzz/LedMatrix

with these lib i'm able to scroll a rectangle between two horizontal matrix modules, probably you can get some ideas...

Code: [Select]

#include <avr/io.h>
#include "LedMatrix.h"

LedMatrix  ledDisplay = LedMatrix(51, 53, 52, 16, 16);

void setup()
{
  ledDisplay.init(8);
  ledDisplay.blank();
  ledDisplay.update();
  Serial.begin(9600);
}

void loop()
{
/*  for (int i=0;i<16;i++) {
   ledDisplay.rectangle(0,0,i,6,1);
   ledDisplay.update();
   Serial.println(i);
   delay(1);
  }
  for (int i=16;i>0;i--) {
   ledDisplay.rectangle(0,0,i,6,0);
   ledDisplay.update();
   Serial.println(i);
   delay(1);
  }
  ledDisplay.blank();
  ledDisplay.update();
*/
  ledDisplay.rectangle(12,2,13,3,GRAPHIC_DRAW_SRC);
  ledDisplay.update();
  for (int i=0;i<16;i++) {
    ledDisplay.scroll(SCROLL_LEFT,0);
    ledDisplay.update();
    delay(10);
  }
}

markruys


SPI, works fine, but some tuning in cascade is required, my test downloadable as movie + readme:


Thank you for your report. As I don't have the hardware to test, it's rather difficult to fix it. But I did found a bug in my rotation code in case of multiple matrices, so you might give the library another try.

markruys


SPI, works fine, but some tuning in cascade is required, my test downloadable as movie + readme:

https://www.dropbox.com/sh/3zx1m6vshfvir4g/k5qnJVpXAo?m

A few days ago I received some additional MAX7219 displays, so I could test the case with multiple displays myself. I did found and fixed a bug. Furthermore, I did a complete rewrite of the code to let you define the display layout. Not only you can define the size of the rectangle, but also which displays are positioned where, and whether they are rotated or not. E.g. in case of four horizontally placed displays, it could be like:
Code: [Select]

  matrix.setPosition(0, 3, 0); // The first display is at <3, 0>
  matrix.setPosition(1, 2, 0); // The second display is at <2, 0>
  matrix.setPosition(2, 0, 0); // The third display is at <0, 0>
  matrix.setPosition(3, 1, 0); // And the last display is at <1, 0>

  matrix.setRotation(0, 2);    // The first display is position upside down
  matrix.setRotation(3, 2);    // The same hold for the last display

Furthermore I made big speed improvements (never NOOP's are send) and lowered the memory footprint. To achieve this, now you need to explicity send the bitmap buffer to the devices (matrix.write()). Updated the examples to use it.

Please feel free to report bugs. I'll post some video's showing the examples in various settings.

markruys

#21
Jun 09, 2013, 02:34 pm Last Edit: Jun 09, 2013, 02:36 pm by Mark Ruys Reason: 1

I'll post some video's showing the examples in various settings.


http://www.youtube.com/watch?v=a8T7ZFeaf1A

http://www.youtube.com/watch?v=FbJJyuCwohs

Code: [Select]

  matrix.setPosition(0, 1, 0); // The first display is at <0, 0>
  matrix.setPosition(1, 1, 1); // The second display is at <1, 0>
  matrix.setPosition(2, 0, 1); // The third display is at <2, 0>
  matrix.setPosition(3, 0, 0); // And the last display is at <3, 0>

  matrix.setRotation(0, 2);    // The first display is position upside down
  matrix.setRotation(3, 2);    // The same hold for the last display


Pedro147

http://www.pedroduino.com

alessiocavalieri

Grat job!!! Incredible speed! Now i must test with my matrix

Sven018

Hello everyone,
I have two things to bring up:

The library won't work under 1.0.5, there is an error in the robotcontrol library ?!

Anyone tries to get Max72xxPanel working with a Due? It is a different SPI interface so some help would be very nice   :D

Best regards,
Sven

alessiocavalieri

Yes, in 1.0.3 compile corecly but in 1.0.5 i get the same error.

junktronix

Thanks for your work on this library.  I got one of these

http://www.mouser.com/new/maxim-integrated/maxim-maxrefdes99/

The example code is not very good.  I came across Max72xxPanel while looking for something better. It looks perfect for what I want to do, but I can't quite get it working right.  I set the arrangement of the 8x8 displays with

Code: [Select]

matrix.setPosition(0, 0, 1);
matrix.setPosition(1, 1, 1);
matrix.setPosition(2, 0, 0);
matrix.setPosition(3, 1, 0);

but the display is upside-down.  If I rotate the displays, it's no longer upside-down, but now is backwards (i.e. ticker scrolls to the right with backwards characters).

It looks like I need to invert / mirror the display(s) instead or rotating.  Unless I'm missing something, I don't see a way to do that.  Can anyone suggest a fix?

junktronix

I found a way to invert the Y axis and get my MAXREFDES99 16x16 display working.  it's an ugly hack though.  I edited the drawPixel call in Max72xxPanel.cpp like so

Code: [Select]

void Max72xxPanel::drawPixel(int16_t xx, int16_t yy, uint16_t color) {
// Operating in bytes is faster and takes less code to run. We don't
// need values above 200, so switch from 16 bit ints to 8 bit unsigned
// ints (bytes).
int8_t x = xx;
byte y = _height-yy-1;  // KPC UGLY KLUDGE to fix inverted MAXREFDES99 display
byte tmp;



EEPblog

Hi, i think i've found the limits of the library. The library for some reason does not like more than 10 matrices in horizontal axis... I'm trying to make an LED sign, and the last 4 matrices don't work at all, but with other libraries for driving max7219's they work, though i could not get the libraries to set up correctly for my LED sign (rotation and positioning). Could you please fix it? I've been trying to brew something up this whole day, but no success...
Follow me on Instagram
-> www.instagram.com/eepblog <-

arduino_john

Hi Marc,
I am attempting to use your MAX72xxpanel library. Seems to work great.
The comment by EEPblog about limits and the last 4 modules not working are strange and confirmed.
If I have 10 modules and set the hdisplays at 10 the last 4 modules do not display anything, If I then connect a further 10 displays I get 2 instances of the same display with all 10 modules working. If I now change hdisplays to 20 the last 4 displays do not work at all, only the first 16 work.
I seems any hdisplay setting above 10 blank out the last 4 modules if hdisplay matches the quantity of modules, I have tried this with various combinations of hdisplay settings and number of modules. If the hdisplay matches the number of modules the last 4v are always blank.
As I am a NOOB at programming the Arduino and using libraries can you possibly give me some idea of where in the libraries I should be looking, MAX72xxPanel or Adafruit_GFX.
Thanks

Go Up