Arduino Project using LED painel 16x32

  1. Hello Guys, my name is Victor and currently i'm working on a project to use an arduino Mega2560 to show time of arrival of buses for bus stops in my city (kinda like in the metro but for busses) .For that i already worked it out an server that relays to the arduino an json with the upcoming schedules and after some manipulation of data it should display it to some LED painels(HHS P7.62 16x32) chained together, I'm now trying to learn how to make the arduino comunicate with 2 of said LED painels but something strange has happen, i been following this guide:
    https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf
    but when running the example code test_shapes 16x32 only the top half light up correctly and the bottom half that should display a different message copied the top half and i was able to identify some glitchs compare to the top which was very clean. Any ideia why this might be happening?

Here is the code i'm using:

// testshapes demo for Adafruit RGBmatrixPanel library.
// Demonstrates the drawing abilities of the RGBmatrixPanel library.
// For 16x32 RGB LED matrix:
// http://www.adafruit.com/products/420

// 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 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// 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 ARDUINO UNO, 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

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

void setup() {

  matrix.begin();

  // draw a pixel in white
//  matrix.drawPixel(0, 0, matrix.Color333(7, 7, 7));
//  delay(500);

//  // fix the screen with green
//  matrix.fillRect(0, 0, 32, 16, matrix.Color333(0, 7, 0));
//  delay(500);

  // draw a box in yellow
//  matrix.drawRect(0, 0, 32, 16, matrix.Color333(7, 7, 0));
//  delay(500);

//  // draw an 'X' in red
//  matrix.drawLine(0, 0, 31, 15, matrix.Color333(7, 0, 0));
//  matrix.drawLine(31, 0, 0, 15, matrix.Color333(7, 0, 0));
//  delay(500);

  // draw a blue circle
//  matrix.drawCircle(7, 7, 7, matrix.Color333(0, 0, 7));
//  delay(500);

  // fill a violet circle
//  matrix.fillCircle(23, 7, 7, matrix.Color333(7, 0, 7));
//  delay(500);

  // fill the screen with black
//  matrix.fillScreen(matrix.Color333(0, 0, 0));

  // draw some text!
  matrix.setCursor(1, 0);  // start at top left, with one pixel of spacing
  matrix.setTextSize(1);   // size 1 == 8 pixels high

  // print each letter with a rainbow color
  matrix.setTextColor(matrix.Color333(7,0,0));
  matrix.print('1');
  matrix.setTextColor(matrix.Color333(7,4,0));
  matrix.print('6');
  matrix.setTextColor(matrix.Color333(7,7,0));
  matrix.print('x');
  matrix.setTextColor(matrix.Color333(4,7,0));
  matrix.print('3');
  matrix.setTextColor(matrix.Color333(0,7,0));
  matrix.print('2');

  matrix.setCursor(1, 9);  // next line
  matrix.setTextColor(matrix.Color333(0,7,7));
  matrix.print('*');
  matrix.setTextColor(matrix.Color333(0,4,7));
  matrix.print('R');
  matrix.setTextColor(matrix.Color333(0,0,7));
  matrix.print('G');
  matrix.setTextColor(matrix.Color333(4,0,7));
  matrix.print('B');
  matrix.setTextColor(matrix.Color333(7,0,4));
  matrix.print('*');

  // whew!
}

void loop() {
  // Do nothing -- image doesn't change
}

and here are some photos(apparently i can put just one photo):

whats is happening:

Any help would be appreciated and sorry for any mistakes, english is not my native language.

From the manual you linked to:

These panels require 12 or 13 digital pins (6 bit data, 6 or 7 bit control)

Although the panels support chaining, this is VERY impractical on Arduino-class boards and our library DOES NOT SUPPORT it. A more powerful system like a Raspberry Pi may be a better choice for chained panels!

Thanks for your answer john, my group is actually debating whether to use a arduino or raspberry pi, but the raspberry pi in my country(Brazil) can sometimes cost as much as 5x- 6x times the price of the arduino + the internet module, so as a way to lower the development costs we thought of giving the arduino a good try before trying with a raspberry.
Also This line "These panels require 12 or 13 digital pins (6 bit data, 6 or 7 bit control)" i didn't quite understand, in the guide it say that an arduino mega should be compatible to control de LED painels, i currently using the pins
Analog: A0,A1,A2
Control: 9,10,11
Digital: 24,25,26,27,28,29
Ground: 4 GND
which is linked through the use of jumpers to a 16-pin flat cable(for testing).
Do i need to use more pins? Also we are discursing later if necessary to add more RAM so the arduino could handle the chained LED painels.
Here a photo:

You seem to be using an Ethernet Shield. Doesn't the shield use Pin 10 and Pin 11 (and 12, 13, and 4)?

@johnwasser I see, yeah that really is a problem, is there a way to use other pins for the LED painel then maybe? Or by software alternate between them(the internet shield and the LED painel)?
This is my first time using a arduino, so i'm pretty much a newbie.

I'm not sure how the library knows which pins to use. Only some of the pins are specified in
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false); and the CLK pin has to be chosen from a limited set of choices.

Correction: On the MEGA the Ethernet Shield uses Pin 10 and the SD Card slot on it uses Pin 4 but the other three SPI pins are in the 50-53 range, not 11,12,13 like on an UNO. That may help.

I don't know what other pins you can use for LAT and OE. Maybe there are no other restrictions.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.