Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: Ruud on Oct 02, 2017, 03:28 pm

Title: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Ruud on Oct 02, 2017, 03:28 pm
I've modified the RGBmatrixPanel.cpp to work with outdoor high brightness P10 32x16 LED panels with 1/4 scanning (4 rows multiplexed) that have a 'snake-pattern' LED row layout (bought here: https://goo.gl/ub1KkE (https://goo.gl/ub1KkE)).

It's based on protonmaster's multipanel fork of the Adafruit RGBmatrixPanel.cpp, so it works with multiple panels. The Adafruit_GFX library can now be used with these panels.

To use this library, replace the original RGBmatrixPanel.cpp and RGBmatrixPanel.h with the attached files.

Note that you have to add an extra parameter to the RGBmatrixPanel call, this is to support muliple panels.
For example: RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 2);

Where 2 is the number of panels. The 'false' disables double buffering. Double buffering reduces flickering but uses twice the amount of memory, use 'true' for flicker-free smooth animation if you have plenty of memory.

Tested with Arduino ATMega2560, examples work great!
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: ShurickStudent on Oct 11, 2017, 11:36 am
Hello. Tell me please. I have Arduino uno and I'm trying to connect to it a 16x32 pixel matrix with 1/4 multiplex. I'm using your library. Now I have incorrectly displayed the image on the matrix. I believe that I incorrectly connected the pins.
In the library itself there is a pinout not for all the pins. There are no specified RGB pins.
If you know the pinout for all contacts (there are 16 of them), please tell me how to connect to Arduino, taking into account this library.
I also attach a link. There on the site there is a picture of the pinout (picture under the inscription Interface Definition). I have such a connection cable to the matrix.
http://www.eager-led.com/html_products/LED-Wall-HUB-Card_HUB75A-793.html (http://www.eager-led.com/html_products/LED-Wall-HUB-Card_HUB75A-793.html)

In advance thanks for the answer.
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Combed on Mar 19, 2018, 03:25 am
great work,  thanks !
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: olorm on Apr 10, 2018, 04:54 am
1:4 scan Where can I modify my spiral pattern?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: robertking111 on Apr 17, 2018, 10:41 am
great workRuud .
can i use 32x32 p10 rgb with 1/4 scan rate by this modified library?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: rello76 on Apr 19, 2018, 03:28 pm
Hi!
I have a P10 with 1/2 scan.
This library didnt work.
Is it possible to adapt? ( i Havnt the "c" pin)
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: WalidAli on May 29, 2018, 08:07 am
Thank you for this modification Ruud

I was trying for along time to fix this problem

everything worked fine for p10 1/4 32*16
but not really with  p10 1/4 32*32 which has only A & B Pins without C and D Pins

How I can deal with this problem?
I think there is something I just need to change in RGBmatrixPanel.cpp or RGBmatrixPanel.h

thank you in advance
waiting for you
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: WalidAli on Jun 01, 2018, 05:21 am
Hello everyone and Thank you Ruud Again
I was trying my best to make it work on my 32x32 1/4 scan panel which has only A & B Pins

Thanks to a forum member called Kolnier who shared an Excel file or spreadsheet on google Documents that lets you draw something on it cell by cell then copy the wanted code which automatically generated and paste to Arduino program to test it on the panel. I downloaded that file and tried to modify to make it work with my 32x32 panel.

It worked after making so many changes to The spreadsheet and Arduino code.

The result was the total right half of the panel worked great, but the other left side is totally blank and not showing anything.

here is the link to the modified sheet 32x32 1/4 scan rate panel spreadsheet  (https://docs.google.com/spreadsheets/d/1dmNk6_NT3ob1xY3baXFO4GU8v3LNv7CTXp5I9pKnb9Y/edit?usp=sharing) Thanks again to Kolnirer who allowed to share and modify.
You will also find some helpful drawings on the other sheets that might guide you to a better solution.


 
and here is the current code I'm using for the Arduino:

Code: [Select]

uint64_t row1[128];
uint64_t temp;

int LP = 8;            // Latch Pin
int ClkP = 12;         // Clock Pin
int R1P = 11;          // R1 Pin
int B1P = 10;          // B1 Pin
int G1P = 9;           // G1 Pin
int R2P = 7;           // R2 Pin
int B2P = 6;           // B2 Pin
int G2P = 5;           // G2 Pin
int AP = 2;            // A Pin
int BP = 3;            // B Pin
int CP = 4;            // C Pin
int OEP = 13;          // OE Pin
int row = 0;
uint8_t i;

void setup() {
//set pins to output so you can control the shift register
pinMode(LP, OUTPUT);
pinMode(ClkP, OUTPUT);
pinMode(R1P, OUTPUT);
pinMode(B1P, OUTPUT);
pinMode(G1P, OUTPUT);
pinMode(R2P, OUTPUT);
pinMode(B2P, OUTPUT);
pinMode(G2P, OUTPUT);
pinMode(AP,OUTPUT);
pinMode(BP,OUTPUT);
pinMode(CP,OUTPUT);
pinMode(OEP,OUTPUT);

digitalWrite(AP, LOW);
digitalWrite(BP, LOW);
digitalWrite(CP, LOW);
digitalWrite(LP, LOW);
digitalWrite(OEP, LOW);
row=0;
temp =  0x00000000000000000000000000000001; 

//------------------------Paste here:

row1[0]=0xC0C0C0FF030303FFC3C3C7FFC3C3C3FF;                       
row1[1]=0XC0C0C0FF030303FFC3C3CFC0C3C3C303;                       
row1[2]=0xC0C0C0C003030303C3C3DFC1C3C3C3C3;                       
row1[3]=0xC0C0C0C003030303C3C3DFC3C3C3C3C3;                       
row1[4]=0xC0C0C0C003030303DFDFC3C3FBFBC3C3;                       
row1[5]=0xC0C0C0C003030303C0DFC3C303FBC3C3;                       
row1[6]=0xFFC0C0C0FF030303FFDFC3C3FFFBC3C3;                       
row1[7]=0xFFC0C0C0FF030303FFDFC3C3FFFBC3C3;   
                   
//----------------------------up to here
}

void loop() {
for(row=0; row<4; row++){
   for (i = 0; i < 128; i++)  {
      digitalWrite(B1P, 0);
      digitalWrite(R1P, 0);
      digitalWrite(G1P, !!(row1[row] & (temp << (127-i))));
      digitalWrite(B2P, 0);
      digitalWrite(R2P, 0);
      digitalWrite(G2P, !!(row1[row+4] & (temp << (127-i))));
      digitalWrite(ClkP, HIGH);
      digitalWrite(ClkP, LOW);
      } 
   digitalWrite(OEP, HIGH);
   digitalWrite(LP, HIGH); 
   digitalWrite(AP, !!(row & B00000001));
   digitalWrite(BP, !!(row & B00000010));
   digitalWrite(CP, !!(row & B00000100));
   digitalWrite(OEP, LOW);
   digitalWrite(LP, LOW); 
   }
}






This should show number 1 on the right side of your panel if it has only A & B Pins and I want it to be working on the whole panel.

please share your experience with everyone.



I hope Someone could solve it and help me finish my project.

Thank you.

Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: pengpeng on Jun 02, 2018, 04:58 am
There are two primary types of drivers for stepper motor wholesale (https://www.oyostepper.com/), constant voltage drives (also referred to as L/R drives), and constant current drives (also referred to as chopper drives)---
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: metuman on Jun 12, 2018, 10:37 am
Hello, I have a question

The library solution you gave was very useful. I have tried all the features of Adafruit and just could not find any information about brightness. There seems to be 2 options for brightness.

The first one is software, but I'm browsing. No one related to RGB panel gave information about brightness.

The second is the current setting and the brightness setting, but it is not very stable, but I wanted to ask you.

If I can not get a result for the first option I will have to try the second one but I want to choose the software version Is there someone that can help?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: metuman on Jun 18, 2018, 02:33 pm
Can you nobody help me?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: WalidAli on Jun 21, 2018, 12:27 pm
Can you nobody help me?
Try to connect (EN for Hub08 Panels) or (OE for Hub75 Panels) to 5v port on the Arduino board.
Be careful not to connect it with GND.
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: KimJangSu on Jul 06, 2018, 03:30 am
ARDUINO 1.8.5

arduino mega2560


I tried sketching P10 RGB 1/4, but with the following error





C:\Users\jangSu\AppData\Local\Temp\ccHiVcko.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_testcolors_16x32.ino.cpp.o.2336':

ccHiVcko.ltrans0.o:(.text.startup+0x7c): undefined reference to `RGBmatrixPanel::RGBmatrixPanel(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, bool, unsigned char)'

collect2.exe: error: ld returned 1 exit status
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Combed on Aug 09, 2018, 05:34 am
seems like didnt work for green colour. i've try to fill the screen (16x32 panel) with full green color, but i never got it, the result showing half green. while red and blue work perfectly.
this is my simple code which i use

matrix.fillScreen(matrix.Color333(0, 7, 0));

for saturation or hue maybe you will get different result than you expected.
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: TALHA72 on Sep 17, 2018, 08:43 am
@Ruud

i used your modified library, it gives me following error,

C:\Program Files (x86)\Arduino\libraries\RGB-matrix-Panel\RGBmatrixPanel.cpp: In member function 'uint16_t RGBmatrixPanel::Color888(uint8_t, uint8_t, uint8_t, boolean)':

C:\Program Files (x86)\Arduino\libraries\RGB-matrix-Panel\RGBmatrixPanel.cpp:254:22: error: 'gamma' was not declared in this scope

   r = pgm_read_byte(&gamma[r]); // Gamma correction table maps

please help,

Regards,
 
Talha.
I've modified the RGBmatrixPanel.cpp to work with outdoor high brightness P10 32x16 LED panels with 1/4 scanning (4 rows multiplexed) that have a 'snake-pattern' LED row layout (bought here: https://goo.gl/ub1KkE (https://goo.gl/ub1KkE)).

It's based on protonmaster's multipanel fork of the Adafruit RGBmatrixPanel.cpp, so it works with multiple panels. The Adafruit_GFX library can now be used with these panels.

To use this library, replace the original RGBmatrixPanel.cpp and RGBmatrixPanel.h with the attached files.

Note that you have to add an extra parameter to the RGBmatrixPanel call, this is to support muliple panels.
For example: RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 2);

Where 2 is the number of panels. The 'false' disables double buffering. Double buffering reduces flickering but uses twice the amount of memory, use 'true' for flicker-free smooth animation if you have plenty of memory.

Tested with Arduino ATMega2560, examples work great!
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: metuman on Sep 20, 2018, 01:54 am
I used modified library with UNO, Pro mini and Mega

Are you running 1/4 scan RGB panel with Arduino due?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: savotech on Sep 29, 2018, 11:08 am
The code worked perfectly for me after debugging some errors in the gamma.h file.

gamma array declaration keyword was diffent from one used on the rgbmatrixpanel.cpp so i modified the gamma.h

See the attached file.
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: lukasik on Nov 04, 2018, 11:23 am
Still dont working :(
https://forum.arduino.cc/index.php?topic=577233.0
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Combed on Nov 08, 2018, 03:33 pm
@Ruud

i used your modified library, it gives me following error,

C:\Program Files (x86)\Arduino\libraries\RGB-matrix-Panel\RGBmatrixPanel.cpp: In member function 'uint16_t RGBmatrixPanel::Color888(uint8_t, uint8_t, uint8_t, boolean)':

C:\Program Files (x86)\Arduino\libraries\RGB-matrix-Panel\RGBmatrixPanel.cpp:254:22: error: 'gamma' was not declared in this scope

   r = pgm_read_byte(&gamma[r]); // Gamma correction table maps

please help,

Regards,
 
Talha.
change this

&gamma -->  &gamma_table
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Freddy144 on Dec 09, 2018, 09:33 am
I've a 32x32 Matrix led without D pin.
I've tried a modified class but not working...
Please help me
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: chempi on Dec 13, 2018, 09:29 pm
Hi!
I have a P10 with 1/2 scan.
This library didnt work.
Is it possible to adapt? ( i Havnt the "c" pin)
Did you solve the problem? I am having the same issue.

Regards
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: gusantor on Dec 30, 2018, 02:54 am
Hello

I'm using, with some success, the modified library posted at top

But I need some help to get a 16x16 RGB P10 1/4 scan panel

I started this topic asking help https://forum.arduino.cc/index.php?topic=587781.0

Please any guide is appreciated

Thanks
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: gusantor on Jan 02, 2019, 02:24 pm
Hi guys

Here is a video of what I'm getting now https://youtu.be/m9r9iTQ_H7I (https://youtu.be/m9r9iTQ_H7I)

As you can see, the script prints first dot (0,0) at 2nd row, I'm guessing this is about the screen layout

I'm trying to modify the library, as far as I can tell, the part that could control this is about line 376 at RGBmatrixPanel.cpp, where shift variabe is defined

Please , any help ?

Thanks

Code: [Select]

void setup() {
  matrix.begin();
}

int pixX = 16;
int pixY = 0;

void loop() {

  matrix.fillScreen(0);

  matrix.drawPixel(pixX, pixY, matrix.Color333(210, 210, 210));

  pixX++;
  if(pixX==32){
    pixX=16;
    pixY++;
    if(pixY==16) pixY = 0;
  }
  delay(60);

  matrix.swapBuffers(false);
}


Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: GFragostini on Jan 04, 2019, 07:29 pm
Hi all! This is my first post on this forum. I created an account because of this very problem, because I have it, too :)  But it seems that this issue is slightly different with everyone.

I implemented Ruud's original code, but it did not solve my problem. My *outdoor* 32x16 1/4-scan panel seem to work OK by writing on lines 1 and 2 in correct order. Also the led colours work fine. But the panel output is messed up with two ways:
1: a single pixel does not appear as a single pixel, but more like some funny "vertical group of fours" depending on the coordinate I wish to place it.
2: Pixel mapping seems to be weird, too (see the pic). I tried to write: "-----" on the second line in wht/red/grn/blu/wht, but all I got was 4-pixel tall bars in weird order.

My panels have a silkscreen saying: "P10(3535)16X32-4S-M2.1"

I tried gusantor's code and I'm having similarities with the pixel "hopping" with an addition of the multiple vertical pixels (4 minus some) appearing on my panel.

It seems to me, that there is no universal standard as to how to build led displays. But I'm sure there must be a way to control each of them. There just must be - they wouldn't build them in millions in the first place if this was not the case... right? :)

So here's my code:

Code: [Select]
#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel_1per4.h> // Hardware-specific library (Ruud's version)

#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT 10
#define OE  9
#define A   A0
#define B   A1
#define C   A2
#define D   A3
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 1); // 1 = amount of panels
void setup() {
  
  
  matrix.begin();

  matrix.setCursor(1, 9);   // next line
  matrix.setTextColor(matrix.Color333(7,7,7));
  matrix.print('-');
  matrix.setTextColor(matrix.Color333(7,0,0));
  matrix.print('-');
  matrix.setTextColor(matrix.Color333(0,7,0));
  matrix.print('-');
  matrix.setTextColor(matrix.Color333(0,0,7));
  matrix.print("-");
  matrix.setTextColor(matrix.Color333(7,7,7));
  matrix.print("-");

}

void loop() {
  // do nothing
}


And here's the pic:
http://s257.photobucket.com/user/knarf_69/media/-----_in_WRGBW.jpg.html?sort=3&o=0

Many thanks in advance for your patience and help! :)

Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Savoir on Jan 23, 2019, 08:26 pm
It looks like the snake pattern for p10 modules is defunct out of China. I've ordered panels from 4 different manufacturers with HUB75, and none of them work now with this library. It's just not the snake "S" pattern anymore. 1/4 scan is also the default, there are no more 1/8 scan except a few indoor modules.

Someone with enough ability should modify this library and change the pattern, it was a very useful library.
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: jjfs85 on Mar 02, 2019, 07:52 am
Folks who are getting four pixels vertically instead of a single pixel, I learned a fun fact: They've inverted the addressing logic!

I made a little test project that pushes a single pixel at a time into the A shift register. I first push a green pixel so you can more easily follow it visually. This shows you the snaking pattern that we have to deal with with the P10 32x16 1/4 scan panels now.

Here's a video of pixels being shifted into the A address on my panel.
https://youtu.be/OY5X-S0kVn4 (https://youtu.be/OY5X-S0kVn4)

My addrressing scheme's seems a bit weird based on what I've been reading. The panel works if I hold all address lines high and then sequence through pulling them low when I want to display the lines. Do other panels use a binary encoded addressing scheme?
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: papbo on Jun 29, 2019, 08:30 pm
Hello,
I have a chrono project running on a Mega 2560 PRO with a 32x16 RGB 1/8S indoor display. This project is working fine.
I have received a couple of 32x16 RGB outdoor 1/4S and my project is not working with this panel.
I have included the RGBmatrixPanel.cpp and RGBmatrixPanel.h from Ruud, but it is still not working.
With a video board, this panel is working fine, panel is not faulty.
On this panel there is a pin D, but I thing that this pin is not used and I have put the pin to GND.
I have loaded a small program to test the display....I try just to write a pixel and a have a vertical line of  dots...
https://youtu.be/I_WL_cQVDW8 (https://youtu.be/I_WL_cQVDW8)
Quote
#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library (Ruud's version)
#define clear()          fillScreen(0)

#define CLK 11  // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT 10
#define OE  9
#define A   A0
#define B   A1
#define C   A2
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false, 1); // 1 = amount of panels
void setup() {
  matrix.begin();
}

void loop() {
  for (int i=0;i<32;i++) {
    matrix.drawPixel(i, 0, matrix.Color333(2, 3, 4));
    delay(200);
  }
  matrix.clear(); 

}
Any idea how to modify the GFX or RGBmatrix library to have this panel working.
Regards
Papbo
Title: Re: P10 32x16 LED panel 1/4 scan now works with Adafruit_GFX
Post by: Robotech-e on Aug 30, 2019, 02:55 am
The code worked perfectly for me after debugging some errors in the gamma.h file.

gamma array declaration keyword was diffent from one used on the rgbmatrixpanel.cpp so i modified the gamma.h

See the attached file.

Hi Savotech,

Thanks for the file, I can compile the sketch, but now I have another problem it is related to the order of the pixels, I hope it will be easier to fix:
the issue is the "y" axis is interchanged on both rows of the panel, for example, if you draw a pixel at x=0, y=0 it appears at x=0, y=4, on the other hand if you draw the pixel x=0, y=4 it appears at x=0, y=0 and is the same with the lower row if you draw a pixel at x=0, y=8, it appears at x=0, y=12

If you write something the letters are cutted by the half.

Is there any chance you can help me? I will really appreciate it

Thank you :-)