32x64 RGB LED matrix not working with library

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.
User avatar
mfenner
 
Posts: 4
Joined: Mon Apr 13, 2015 8:21 pm

32x64 RGB LED matrix not working with library

Post by mfenner »

My 32x64 matrix appears to be functioning improperly. If I instantiate it with a width of 64 as such:

Code: Select all

RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false, 64);
nothing shows up on the display at all. And if instantiate it with no width declared, it defaults to 32 and everything is mirrored between the two halves. How do I get the library to function properly?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 32x64 RGB LED matrix not working with library

Post by adafruit_support_rick »

Are you running the testshapes_32x64.ino example sketch?

Can you post a picture of your wiring?

User avatar
mfenner
 
Posts: 4
Joined: Mon Apr 13, 2015 8:21 pm

Re: 32x64 RGB LED matrix not working with library

Post by mfenner »

Yep, I was running testshapes_32x64 but I also wrote some custom code that just scrolled through individual pixels to verify what was happening.

Wiring photos are attached and the non-RGB pins are as follows:

#define CLK 8 // MUST be on PORTB!
#define OE 9
#define LAT 10

#define A A0
#define B A1
#define C A2
#define D A3
Attachments
IMG_2055 copy.jpg
IMG_2055 copy.jpg (864.47 KiB) Viewed 1562 times
IMG_2053 copy.jpg
IMG_2053 copy.jpg (884.13 KiB) Viewed 1562 times

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

Re: 32x64 RGB LED matrix not working with library

Post by pburgess »

Ah - I see you're connected to an Uno. There's not enough RAM on that board to drive the 64x32 matrix; it requires a Mega (or something more substantive like Raspberry Pi). It's mentioned near the top of the testshapes_32x64 code.

User avatar
mfenner
 
Posts: 4
Joined: Mon Apr 13, 2015 8:21 pm

Re: 32x64 RGB LED matrix not working with library

Post by mfenner »

It's not like it runs slowly though, it doesn't run at all. Even if I'm just doing one pixel at a time, it isn't able to instantiate a matrix of that size. Is that just not a possibility at all, even if the load is fairly low?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 32x64 RGB LED matrix not working with library

Post by adafruit_support_rick »

It has to instantiate a buffer for the entire 32x64, and there isn't enough SRAM for that on a Uno

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

Hey, I have been having similar problems using the 32 x 64 LED Matrix. I have set up all of the connections from the Matrix itself to the arduino MEGA and downloaded the necessary libraries. All i really want to do is print text on the matrix and I am unable to do so with the code given. Here is the code that I am using:

Code: Select all

// testshapes demo for RGBmatrixPanel library.
// Demonstrates the drawing abilities of the RGBmatrixPanel library.
// For 32x32 RGB LED matrix.

// NOTE THIS CAN ONLY BE USED ON A MEGA! NOT ENOUGH RAM ON UNO!

#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 11  // MUST be on PORTB!
#define OE  13
#define LAT A7

#define A   A0
#define B   A1
#define C   A2
#define D   A3

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

void setup() {
     matrix.begin();
     matrix.print('6');

}

-----
so, I changed the CLK to pin 11 as mentioned in the online tutorial. I also changed the LAT and the A-D definitions because the online tutorial had them marked in different analogs than in the given code. is this something that I shouldn't have done?

All i see now when i run my code is random colors on all of the LED's, so I know the matrix itself is working, but I need some help with the definitions(CLK and A-D wires) and what goes in the setup().


Thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 32x64 RGB LED matrix not working with library

Post by adafruit_support_rick »

Could be that your wiring is wrong. Can you post some pictures?

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

The "Connecting with Jumper Wires" Section on the adafruit website(shown in the picture), states that if the D pin is present(how do i know if the D pin exists for my 32x64 matrix on arduino mega), D should be connected to A3. Then, right below, it states that the LAT wire should be connected to the A3 pin as well. Where should D and LAT wires be connected on the Arduino Mega?
Attachments
lat copy.png
lat copy.png (135.74 KiB) Viewed 1488 times

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

Re: 32x64 RGB LED matrix not working with library

Post by pburgess »

I think the text in that part of the guide is backwards...
For a 32-row matrix, the 'D' pin should go to A3, 'LAT' should go to pin 10.
i.e. the diagram is correct, but accompanying text in the right column got the cases swapped.

I'm gonna double-check all this and will update the guide appropriately.

Also, I just noticed the testshapes_32x64 code uses totally a totally different and zany wiring scheme. That's not good. I'll fix that code too, but in the meantime, copy-and-paste the pin definitions from the top of one of the 32x32 examples, see if that works.

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

Ok thank you. Could you notify me when you update the 32_64 code online? thanks

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

I changed the D and LAT to their correct definitions with the 32_32 code(below), and it is still not working. should the code below function properly?

Code: Select all

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

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

#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 11  // MUST be on PORTB! (Use pin 11 on Mega)
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3
// If your matrix has the DOUBLE HEADER input, use:
//#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
//#define LAT 9
//#define OE  10
//#define A   A3
//#define B   A2
//#define C   A1
//#define D   A0
RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);

void setup() {

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

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

  // draw a box in yellow
  matrix.drawRect(0, 0, 32, 32, matrix.Color333(7, 7, 0));
  delay(500);
  
  // draw an 'X' in red
  matrix.drawLine(0, 0, 31, 31, matrix.Color333(7, 0, 0));
  matrix.drawLine(31, 0, 0, 31, matrix.Color333(7, 0, 0));
  delay(500);
  
  // draw a blue circle
  matrix.drawCircle(10, 10, 10, matrix.Color333(0, 0, 7));
  delay(500);
  
  // fill a violet circle
  matrix.fillCircle(21, 21, 10, 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
  matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves

  matrix.setTextColor(matrix.Color333(7,7,7));
  matrix.println(" Ada");
  matrix.println("fruit");
  
  // print each letter with a rainbow color
  matrix.setTextColor(matrix.Color333(7,0,0));
  matrix.print('3');
  matrix.setTextColor(matrix.Color333(7,4,0)); 
  matrix.print('2');
  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.println('2');
  
  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
}
Last edited by adafruit_support_rick on Fri May 01, 2015 8:16 am, edited 1 time in total.
Reason: please use Code tags when posting code (</> button)

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

This is what it looks like when i run the 32_32 code(above) with the correct defiitions.
Attachments
unnamed.jpg
unnamed.jpg (22.99 KiB) Viewed 1454 times

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

Re: 32x64 RGB LED matrix not working with library

Post by pburgess »

OK, had a chance to wire this up and test things...

Guide indeed had the two pins backwards (they were correct in the image, but swapped in the text description). Fixed.

testshapes_32x64 indeed had a different pin assignment than the guide. This too is fixed now, latest code is on Github. That example should now be plug-and-play with your Mega and 32x64 matrix...try that one.

If it's not working, something's wonky in the wiring. In that case, it'd be helpful to see clear photos of the connections on the ribbon cable and on the Arduino Mega.

User avatar
charlesbarkley
 
Posts: 11
Joined: Thu Apr 30, 2015 12:31 am

Re: 32x64 RGB LED matrix not working with library

Post by charlesbarkley »

I pulled the code from github and ran it and the output on the matrix was the same as before.(shown above)

Here are the screenshots of my connections from the ribbon to my arduino mega. I've already checked that they are correct but another set of eyes doesn't hurt.

for some reason, the pictures cannot be uploaded to the forum. Here is a link to them on dropbox.
https://www.dropbox.com/sh/xckizziw65k5 ... YF_Va?dl=0
Last edited by charlesbarkley on Fri May 01, 2015 3:13 am, edited 1 time in total.

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

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