Hello to all.
So something wrong with Adafruit_GFX.h or <RGBmatrixPanel.h> library. Who can check?
The problem is that when i put something in matrix.drawPixel(x, y, RGB_png[ HERE ]); accept just number like RGB_png[1] the RGB acts crazy lights up some other random LED . And absolutely uncontrol able.
So simply what I wanna do to test is just run the first row of 32 leds collored from RGB_png Array
And like I said if just do like that RGB_png[0] with a digit insert the matrix.drawPixel function pick the color for the first LED and light this LED with that collor no problem...
But if I put in RGB_png from for or do like that
- int index = Serial.parseInt();*
- matrix.drawPixel(x, y, RGB_png[index]);*
- The panel act messy.. Check Picture...*
- So do you know why?*
```
*#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#define CLK 8 // MUST be on PORTB!
#define LAT 10
#define OE 9
#define A A0
#define B A1
#define C A2
#define D A3
RGBmatrixPanel matrix (A, B, C,D, CLK, LAT, OE, false);
const unsigned int RGB_png[] ={ 0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,0xE8E4,
0x2589,0x2589,0x2589,0x2589,0x2589,0x2589,0x2589,0x2589,0x2589,0x2589,
0x3A59, 0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,0x3A59,};
void setup(){
Serial.begin(9600);
Serial.println("Start");
matrix.begin();
matrix.setRotation(4);
}
void loop(){
for(int x=0; x<=32; x++){ // messy
matrix.drawPixel(x, y, RGB_png[x]);
delay(20);
}
// If I do like that : so it's lights all LED with same 0xE8E4 color which means it's ok to pick the color from array
for(int x=0; x<=32; x++){ // works
matrix.drawPixel(x, y, RGB_png[0]);
delay(20);
}
}*
```