Hey guys, I have been working with my 32x32 led matrix from adafruit recently and I have the demo code running just fine, but when I try to run my own code it doesn't do anything near expected. I am just trying to get an idea of controlling the LED's right now, and when I try to turn one on, it turns on entire rows in random colors.
Here is the code I have so far:
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#include <avr/pgmspace.h>
// If your matrix has the DOUBLE HEADER input, use:
#define CLK 11 // MUST be on PORTB!
#define LAT 9
#define OE 10
#define A A0
#define B A1
#define C A2
#define D A3
//variables
#define ALIVE 1
#define DEAD 0
#define MAX_ROWS 16
#define MAX_COLS 16
RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);
int cells[16][16] = {0};
int16_t color = 0; //holds current cell color value
void setup(){
matrix.begin();
Serial.begin(9600);
color = matrix.Color333(0,191,255);
Serial.print("matrix color set\n");
matrix.drawPixel(15,0, color);
Serial.print("matrix dot drawn");
//matrix.fillRect(0, 0, 32, 32, matrix.Color333(0, 7, 0));
//matrix.updateDisplay();
}
The loop function does nothing at the moment so I didn't inlcude it. When I simply try to turn on a single led like in both the sparkfun and adafruit code, I get this random display of LEDs:
Has anyone here had any experience with coding these? Any ideas on fixing this would be greatly appreciated!