Multiple 16x32 RGB LED matrix panel

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
fxsaxotenor
 
Posts: 1
Joined: Sun Sep 29, 2013 6:47 am

Re: Multiple 16x32 RGB LED matrix panel

Post by fxsaxotenor »

Hi do you publish any tutorial about this project ?

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Multiple 16x32 RGB LED matrix panel

Post by adafruit_support_bill »

Yes. There are 3 tutorials for this product. See the "Tutorials" tab on the product description page: http://www.adafruit.com/products/420#Learn

User avatar
jbrogdon
 
Posts: 3
Joined: Mon Sep 27, 2010 11:42 am

Re: Multiple 16x32 RGB LED matrix panel

Post by jbrogdon »

FYI. With minor wiring and code changes, I was able to cascade two of the 16x32 panels using the Teensy++ 2.0 (http://www.adafruit.com/products/731). Note that the Teensy++ 2.0 uses the AT90USB1286, with 8K of SRAM, vs the ATmega328, with 2K. This allows for double-buffering, providing smooth scrolling.

I installed the Teensyduino software add-on (http://www.pjrc.com/teensy/teensyduino.html), allowing me to use the Arduino IDE to build/program the Teensy++. Starting with the multi-panel version of RGBmatrixPanel.cpp, provided by hiduino (in this thread), I used AVR Port C for the DATAPORT and AVR Port E for SCLKPORT. After making the corresponding changes to the wiring, it just worked beautifully.

In order to maintain compatibility with standard Arduino, I wrapped my changes in the processor specific section of RGBmatrixPanel.cpp as follows:

Code: Select all

...
#elif defined(__AVR_AT90USB1286__)
#define DATAPORT PORTC
#define DATADIR  DDRC
#define SCLKPORT PORTE
#else
...

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

I'm trying to use two 16 x 32 panels together in an Arduino Mega. I've got the latest Adafruit_GFX.h and RGBmatrixPanel.h libraries.

The two panels are wired together running the scrolltext_16x32 sketch (I removed bouncing ball code). Both panels display the same thing at the same time, which I expect. I saw from the discussion on GitHub (https://github.com/adafruit/RGB-matrix-Panel/issues/4) that I should use the following function when using multiple panels:

Code: Select all

RGBmatrixPanel(uint8_t a, uint8_t b, uint8_t c, uint8_t sclk, uint8_t latch, uint8_t oe, boolean dbuf, uint8_t pwidth);
where pwidth is the number of panels. I don't know if pwidth should be pixel width or panel count. I tried 2 and 64, but when I do, both panels are blank, nothing displays. The same is true even if I use 1 or 32 for pwidth. I also tried setting dbuf to both true and false, but that didn't help.

Here's the whole skecch

Code: Select all

#include <Adafruit_GFX.h>   // http://github.com/adafruit/Adafruit-GFX-Library
#include <RGBmatrixPanel.h> // http://github.com/adafruit/RGB-matrix-Panel

// Pin definitions for Mega
#define CLK 50
#define OE  51
#define A   A0
#define B   A1
#define C   A2
#define LAT A3

// Last parameter = 'true' enables double-buffering, for flicker-free,
// buttery smooth animation.  Note that NOTHING WILL SHOW ON THE DISPLAY
// until the first call to swapBuffers().  This is normal.
// RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);

// Two panels  - this doesn't work
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 2);

char   str[]   = "Hello World";
int    textX   = matrix.width(),
       textMin = sizeof(str) * -12;
long   hue     = 0;

void setup() {
  matrix.begin();
  matrix.setTextWrap(false); // Allow text to run off right edge
  matrix.setTextSize(2);
}

void loop() {
  byte i;

  // Clear background
  matrix.fillScreen(0);

  // Draw big scrolly text on top
  matrix.setTextColor(matrix.ColorHSV(hue, 255, 255, true));
  matrix.setCursor(textX, 1);
  matrix.print(str);

  // Move text left (w/wrap), increase hue
  if((--textX) < textMin) textX = matrix.width();
  hue += 7;

  // Update display
  matrix.swapBuffers(false);

  delay(15);  // slow down scroll
}

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Multiple 16x32 RGB LED matrix panel

Post by pburgess »

The Adafruit library doesn't support chaining displays...looks like you're using protonmaster's fork? That would be the person to talk to in that case.

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

ok. Since this was being discussed in the GitHub issues section for the Adafrut version of the library, I assumed it was all the same.

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

I got it working with two displays. I downloaded RGBmatrixPanel.cpp from this post on July 18.
You don't need to add a parameter for the number of panels or panel width. I just used:

Code: Select all

RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true );

protonmaster
 
Posts: 1
Joined: Fri Dec 06, 2013 8:36 pm

Re: Multiple 16x32 RGB LED matrix panel

Post by protonmaster »

It appears that there maybe multiple versions of code that people have made for using multiple displays.

I have compiled your sketch using my version of RGB Matrix Panel with out any issue. Though the animation does look a lot nicer when buffering is turned on.

It seems you have found a solution.

I will update the documentation to better describe what pWidth does. (it is the number of panels put together)

Thanks

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

protonmaster wrote:It appears that there maybe multiple versions of code that people have made for using multiple displays.

I have compiled your sketch using my version of RGB Matrix Panel with out any issue. Though the animation does look a lot nicer when buffering is turned on.

It seems you have found a solution.

I will update the documentation to better describe what pWidth does. (it is the number of panels put together)

Thanks
Where can I get your version? I thought I had your version, but I get a blank display when I use double buffering, so now I'm not so sure.

Here's the sketch I tried. I makes a bus move across the display.

Code: Select all

#include <Adafruit_GFX.h>   // http://github.com/adafruit/Adafruit-GFX-Library
#include <RGBmatrixPanel.h> // http://github.com/adafruit/RGB-matrix-Panel

// Pin definitions for Mega
#define CLK 50
#define OE  51
#define A   A0
#define B   A1
#define C   A2
#define LAT A3

#define DOUBLEBUFFER false // When true, increases refresh rate so there is no flickering
                           // with two displays DOUBLEBUFFER needs to be false, although it can be true in the scrolltext_12x32.ino sketch

RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, DOUBLEBUFFER);

static unsigned char PROGMEM moover[] = {
  B01111111, B11111111, B11111100, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10111110, B11111011, B11100010, B00000000,
  B10000000, B00000000, B00000011, B11000000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B01111111, B11111111, B11111111, B11000000,
  B00010010, B00000000, B00010010, B00000000,
  B00100001, B00000000, B00100001, B00000000,
  B00010010, B00000000, B00010010, B00000000,
  B00001100, B00000000, B00001100, B00000000
};


void setup() 
{
  Serial.begin(9600);
  matrix.begin();

  matrix.fillScreen(0);  // fill the screen with 'black'
  matrix.drawBitmap(0, 0, moover, 32, 16, matrix.Color333(7,4,0) ); 
  delay(2000); 
   
}

void loop() 
{
  static uint32_t scrollDelay;
  static int xpos; 

  if ( xpos < 65 && ((long) (millis() - scrollDelay) > 0))
  {
    matrix.fillScreen(0);  // fill the screen with 'black'
    matrix.drawBitmap(xpos++, 0, moover, 32, 16, matrix.Color333(7,4,0) ); 
    scrollDelay = millis() + 100;
  }
  
  if (xpos == 65)
  { 
    xpos = 0; 
    scrollDelay = millis() + 500;
  }
 
}
Also, in this sketch, the bus is first displayed as a complete bus left justified on the left panel. Then scrolls across to the right, I'd like the bus to appear as if it was starting from off the display and scrolling onto the display. So at first you just see the front of the bus, then more and more would be visible. Any idea how to do this?

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

protonmaster wrote:It appears that there maybe multiple versions of code that people have made for using multiple displays.

I have compiled your sketch using my version of RGB Matrix Panel with out any issue. Though the animation does look a lot nicer when buffering is turned on.

It seems you have found a solution.

I will update the documentation to better describe what pWidth does. (it is the number of panels put together)

Thanks
Protonmaster,
I downloaded your version from GitHub, thanks.

I have a sketch that scrolls a bus across two panels. I'm using a Mega and it works fine with double buffer off, but if I turn on double buffering, the displays are blank. Here's my code:

Code: Select all

#include <Adafruit_GFX.h>   // http://github.com/adafruit/Adafruit-GFX-Library
#include <RGBmatrixPanel.h> // http://github.com/protonmaster/RGB-matrix-Panel

// Pin definitions for Mega
#define CLK 50
#define OE  51
#define A   A0
#define B   A1
#define C   A2
#define LAT A3

RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 2);

static unsigned char PROGMEM moover[] = {
  B01111111, B11111111, B11111100, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10100010, B10001010, B00100010, B00000000,
  B10111110, B11111011, B11100010, B00000000,
  B10000000, B00000000, B00000011, B11000000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B10000000, B00000000, B00000000, B00100000,
  B01111111, B11111111, B11111111, B11000000,
  B00010010, B00000000, B00010010, B00000000,
  B00100001, B00000000, B00100001, B00000000,
  B00010010, B00000000, B00010010, B00000000,
  B00001100, B00000000, B00001100, B00000000
};

void setup() 
{
  matrix.begin();
  matrix.fillScreen(0);  // fill the screen with 'black'
  matrix.drawBitmap(0, 0, moover, 32, 16, matrix.Color333(7,4,0) ); 
  delay(1000); 
}

void loop() 
{
  static uint32_t scrollDelay;
  static int xpos; 
  
  if ( xpos < 65 && ((long) (millis() - scrollDelay) > 0))
  {
    matrix.fillScreen(0);  // fill the screen with 'black'
    matrix.drawBitmap(xpos++, 0, moover, 32, 16, matrix.Color333(7,4,0) ); 
    scrollDelay = millis() + 100;
  }
  
  if (xpos == 65)
  { 
    xpos = 0; 
    scrollDelay = millis() + 500;
  }
}
Is there anything I can do to get double buffering to work with this?

ejrua
 
Posts: 3
Joined: Thu Jan 09, 2014 1:09 pm

Re: Multiple 16x32 RGB LED matrix panel

Post by ejrua »

Driver Raspberry Pi Matrix 16x32 RGB Matrix?

marcin101010
 
Posts: 2
Joined: Thu Feb 27, 2014 4:23 am

Re: Multiple 16x32 RGB LED matrix panel

Post by marcin101010 »

hiduino wrote:Well, I tried it just for giggles. I cascaded 4 16x32 RGB Panels together for a 16x128 matrix display. I scaled the code by 4 and it sort of works. Yes, the refresh rate slowed down and the pixel shift was a little jerky. There was also a slight shift from the upper 8 lines and lower 8 lines by about one pixel. I guess this is expected given the the limits of a 16MHz ATmega1284P board.

I suppose there could be some timing adjustments to improve it a little. You could also overclock the AVR mcu to 24 MHz (I even heard someone overclocking to 32MHz, that would be something), but the timing routines would need to be adjusted for that. Yes, I could explore other higher speed platforms, but its interesting to see the limits of Atmel AVRs.
Adafruit16by128QuadMatrixPanel.jpg
Hi.

I working with that panels but target is to connect 16 pcs of them and build 128x64 screen.
At the beginnig I though it could be Xmega 256B1(128A1U) but I'm not sure
What type of transfer has been used (SPI,DMA(+PWM),EBI) or just simple loop ?

marcin101010
 
Posts: 2
Joined: Thu Feb 27, 2014 4:23 am

Re: Multiple 16x32 RGB LED matrix panel

Post by marcin101010 »

hiduino wrote:Well, I tried it just for giggles. I cascaded 4 16x32 RGB Panels together for a 16x128 matrix display. I scaled the code by 4 and it sort of works. Yes, the refresh rate slowed down and the pixel shift was a little jerky. There was also a slight shift from the upper 8 lines and lower 8 lines by about one pixel. I guess this is expected given the the limits of a 16MHz ATmega1284P board.

I suppose there could be some timing adjustments to improve it a little. You could also overclock the AVR mcu to 24 MHz (I even heard someone overclocking to 32MHz, that would be something), but the timing routines would need to be adjusted for that. Yes, I could explore other higher speed platforms, but its interesting to see the limits of Atmel AVRs.
Adafruit16by128QuadMatrixPanel.jpg
Hi.

I working with that panels but target is to connect 16 pcs of them and build 128x64 screen.
At the beginnig I though it could be Xmega 256B1(128A1U) but I'm not sure
What type of transfer has been used (SPI,DMA(+PWM),EBI) or just simple loop ?

User avatar
davideffendi
 
Posts: 5
Joined: Wed Mar 05, 2014 6:45 am

Re: Multiple 16x32 RGB LED matrix panel

Post by davideffendi »

hi everyone, im newbie uC. i try to cascade 2x (16x32)= 16x64, using arduino mega 2560, RGBmatrixPanel.cpp has already changed. i used example scrolltext, the both panel show same display, its like paralel board. pls advised me what the problem.

User avatar
scott216
 
Posts: 163
Joined: Sun Apr 12, 2009 11:08 am

Re: Multiple 16x32 RGB LED matrix panel

Post by scott216 »

davideffendi wrote:hi everyone, im newbie uC. i try to cascade 2x (16x32)= 16x64, using arduino mega 2560, RGBmatrixPanel.cpp has already changed. i used example scrolltext, the both panel show same display, its like paralel board. pls advised me what the problem.
Don't use the library from Adafruit (delete it), and use this one instead (it supports multiple displays)
https://github.com/protonmaster/RGB-matrix-Panel
It's basically a copy of Adafruit's library with multiple display support added.

Instead us using this code:

Code: Select all

RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);
Use this:

Code: Select all

#define NUMDISPLAYS 2
#define DOUBLEBUFFER false
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, DOUBLEBUFFER, NUMDISPLAYS);
If that works you can try setting DOUBLEBUFFER true. This will make the display look smoother, but it doesn't always work and you might get a blank display.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”