Help with 16x32 RGB matrix using Arduino Mega

Hi, I have been trying to fix my 16x32 RGB matrix for the past few days and still could not find the problem with the bottom half of the screen where is sometime just show full blue for a moment then go back afterwards

<CODE/>

this is the code i use for testing
// scrolltext demo for Adafruit RGBmatrixPanel library.
// Demonstrates double-buffered animation on our 16x32 RGB LED matrix:
// http://www.adafruit.com/products/420
// DOUBLE-BUFFERED ANIMATION DOES NOT WORK WITH ARDUINO UNO or METRO 328.

// Written by Limor Fried/Ladyada & Phil Burgess/PaintYourDragon
// for Adafruit Industries.
// BSD license, all text above must be included in any redistribution.

#include <RGBmatrixPanel.h>

// Most of the signal pins are configurable, but the CLK pin has some
// special constraints.  On 8-bit AVR boards it must be on PORTB...
// Pin 11 works on the Arduino Mega.  On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).

//#define CLK  8   // USE THIS ON ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE   9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2

// 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);

// Similar to F(), but for PROGMEM string pointers rather than literals
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr

const char str[] PROGMEM = "Adafruit 16x32 RGB LED Matrix";
int16_t    textX         = matrix.width(),
           textMin       = (int16_t)sizeof(str) * -12,
           hue           = 0;
int8_t ball[3][4] = {
  {  3,  0,  1,  1 }, // Initial X,Y pos & velocity for 3 bouncy balls
  { 17, 15,  1, -1 },
  { 27,  4, -1,  1 }
};
static const uint16_t PROGMEM ballcolor[3] = {
  0x0080, // Green=1
  0x0002, // Blue=1
  0x1000  // Red=1
};

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);

  // Bounce three balls around
  for(i=0; i<3; i++) {
    // Draw 'ball'
    matrix.fillCircle(ball[i][0], ball[i][1], 5, pgm_read_word(&ballcolor[i]));
    // Update X, Y position
    ball[i][0] += ball[i][2];
    ball[i][1] += ball[i][3];
    // Bounce off edges
    if((ball[i][0] == 0) || (ball[i][0] == (matrix.width() - 1)))
      ball[i][2] *= -1;
    if((ball[i][1] == 0) || (ball[i][1] == (matrix.height() - 1)))
      ball[i][3] *= -1;
  }

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

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

#if !defined(__AVR__)
  // On non-AVR boards, delay slightly so screen updates aren't too quick.
  delay(20);
#endif

  // Update display
  matrix.swapBuffers(false);
}

<CODE/>

I have already tested all my pixel led working normally before running the code above

Panel info:P6-16X32-A

library installed: Adafurit BusIO,Adafruit GFX Library, RGB matrix Panel

Analog: A0,A1,A2
Control: 9,10,11
Digital: 24,25,26,27,28,29
Ground: 4 GND

place code between CODE tags.

``` <- three backticks (found below the tilde)

// paste your formatted code here
void setup() {
  // indented
}
void loop() {
  // indented
}

``` <- three backticks (found below the tilde)

There is not a 16x32 panel on the photo

thx for helping out

its 2 ,16x32 panel together

I see the same picture twice... so the library knows your panel to be 8x32. Then it repeats the pattern (because computers do what they are told). It does not know the "16" part, and maybe not the "64" part. Panels usually need to know physical configuration, the "pattern" of connected panels, like by-rows, by-cols, serpentine, zig-zag.

I see the image descends into the 9th row... so that is the whole picture.

This is your library... GitHub - adafruit/RGB-matrix-Panel: Arduino library and example code for the 16x32 RGB matrix panels in the shop

It references this library... GitHub - pixelmatix/SmartMatrix: SmartMatrix Library for Teensy 3, Teensy 4, and ESP32

tried it and still the same it run ok for a while till it became blue. check wire all good and redone it 5 time same results each time

its not a whole picture its the code for sctolltext_16x32 both the panel are running the same code as its in series connection

Yes, it is the whole picture. The fourth (and eighth) 8x8 on the bottom has a row of color from the 8x8 above it.

That is what I wrote. It is the whole picture (but I scratched out "I see the same picture twice").

By the way, RGBMatrixPanel library doesn't support series connection of multiple panels.
But I think that the main cause of the issue is lack of power for two panels. Each 16x32 matrix requires up to 7A
What is your power supply?

currently i'm using a solar panel with a battery to power the matrix along with arduino mega(USB)

These panels can't be powered from USB, use a 5v external psu with at least 5A output.

so solar power with battery + arduino mega(usb) to power the matrix is not enough?

It depends on output of your solar controller. see above, I indicated the current that is needed for LED panels.

i have tried the method where i use external psu with 5A output the result still remain the same. Maybe it could be the library i'm using which is not compatible,mind helping me.

Your library doesn't support a multiple panels, did you tried it with a single panel connection?

I tried running the code using only 1 panel and it still the same as the photo.

Have you seen this 44 page document by Adafruit? Maybe it has connection information that will get your panels working...

1 Like

i change all my wire and it finally work? The pin are the same as the pdf you send only changed the wires. Anyway , Thanks for helping me out and giving me that link :smiley:

1 Like