Hey, I need some advice on how to get my 32x16 led matrix to work. I know i got the wiring right, however the programming side is somewhat a mystery. It's a "P8-SMD32X16B" led matrix with a "pr4538dw" microcontroller, also uses HUB75. I was following the adafruit tutorial on it and using the examples that they provided... Not only I couldn't get it working with my own code but the examples wont work either. Basically what i see is my led matrix doing some nonsense, it's switching colors but it wont show anything it's supposed to...
Basically what i see is my led matrix doing some nonsense, it's switching colors but it wont show anything it's supposed to...
And, from that, you concluded that
I know i got the wiring right
Interesting conclusion. Not one I would have made, I don't think.
Also i forgot to mention that im working with Arduino nano (tried on arduino mega too, same result). Well I mean I followed the tutorial I mentioned, and redid the wiring like 3 times, just to check is that the problem. So i dunno...
If you want us to take you seriously and do our best to help, smarten up! Go read the forum guidelines in the sticky post that will tell you what you should have included in your posts.
Right. Well I did all the googling I could...
The tutorial I followed: https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf
Example code i'm using:
// scrolltext demo for Adafruit RGBmatrixPanel library.
// Demonstrates double-buffered animation on our 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
// 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);
// Double-buffered mode consumes nearly all the RAM available on the
// Arduino Uno -- only a handful of free bytes remain. Even the
// following string needs to go in PROGMEM:
// 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 = 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);
}
I connected the Arduino nano with the led matrix like so:
led matrix pins
RD1 -> D2
GD1 -> D3
BD1 -> D4
GND -> GND
RD2 -> D5
GD2 -> D6
BD2 -> D7
GND -> GND
A -> A0
B -> A1
C -> A2
GND -> GND
CLK -> D8
LAT -> D10
OEB -> D9
GND -> GND
Ok, now post the link to where you bought your display. This time, please post the link using the insert link icon, so you can click on it.
Like this.
I don't know man, you see i'm doing this for work experience. I did ask the lad that's giving me these tasks where did he buy this, he said "It's not important...". Was gonna check if there was some kind of documentation about it, I bet you wanted to check the same thing. Anyhow I ended up just leaving it for tomorrow and going home.
Dum:
he said "It's not important..."
To him, it isn't important: it's your problem now!
True... that's why I'm asking for help.
Well, we will do what we can, but you need to be our eyes, and do most of the leg work and a lot of the thinking too! You also need to always be thinking "what do they need to know" and we know that's not easy. You will be telling us stuff and we will be thinking "that's obvious, why doesn't he tell us X" so try to be patient and we will do likewise. This won't be quick, we will all need to persevere. Sorry if that sounds like a lecture, but I don't want to set false expectations.
Hello, I'm back at it again, this time i got a bit more info. There is nothing on the page that "I" bought, or so I was informed. Also using the examples from HERE
The code looks like this now:
#include <RGBmatrixPanel.h>
#define CLK 8
#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();
matrix.drawPixel(0, 0, matrix.Color333(7, 7, 7));
}
void loop() {
}
The libraries and the code probably doesn't work with my matrix or I REALLY messed up the wiring.
The code should turn on the first led and make it white, instead it turns on 2 leds in the middle of the matrix not even near each other, at least it's on the same line and they are white.
That being said you guys know everything I do now, I cant tell you what I don't know.
I'll give it another shot, but if today won't give any progress I'll just give up on it and move to programming instead. If I do manage to solve this puzzle I'll let you lads know how.
One issue that's obvious to spot: you connect wires to 12 pins of your Arduino, while your code uses only 6 of them. That can't be right. It looks like the code you use is for a different display than what you have.
So first of all you have to find out what exact display you have, and what exact driver IC it uses. As long as you don't know that, the only chance you have to get it to work is by randomly trying libraries and code that are related to such displays, and that at the very least match the number of connections you actually have.
Take some will-lit, well-focussed pictures of the back of the display, including close-ups of the connectors and larger chips, so that any labels can be read, and attach those to a post.
Those two LEDs that the sketch lights up white: what are their coordinates (row/column)? Remember that row and column numbers start at zero: the sketch is trying to light the led in row 0, column 0.
wvmarle:
you connect wires to 12 pins of your Arduino, while your code uses only 6 of them.
The AdaFruit library that the OP is using assumes pins 2 to 7 are also used on Uno. I strongly suspect the library uses direct port manipulation on these pins, which is why they are fixed and cannot be specified in the sketch (all on port D). Despite the dire warnings in the tutorials, I would think using a Nano is also OK as they both use atmega328 and have same pin-port mapping.
I see. Would make sense - 6 data pins on one PORT can make for very fast manipulation, just a few clock ticks to set them all.
Okay so, the lad bought a lot of them and it uses custom hardware and software. He bought then for advertising, you get a lot of 32x16 led matrix'es connect them together and you get a nice screen. At this point I'm thinking of giving up, the software It uses is "LED Studio" And I don't think so I can use it with my arduino, Ill post a few pictures of it in a second.
The LEDASIC PR4538DW appears to be the main controller (if only because there's only one of them).
It appears to be a domestic Chinese product, it's readily available on Taobao but not on Mouser, Digikey or RS Components.
Some more digging provided a data sheet of the thing - short, and in Chinese, see attachment.
And finally something that resembles a basic write-up in English - well, it's far worse than a Google translation would have been...
PR4538-Ledasic.pdf (917 KB)
Tbh this just makes it more confusing...