Hi Hans, hope you doing well.
I'd like to request your help with a bit of code. I'm programming a LED matrix and still doing the setup routine, but for some reason my rows and columns seems to come out messed up. I'm using an teensy3.2 which has enough RAM to drive all my LEDS but I just cant seem to get rows and columns correct. Below is a copy of the code currently. The matrix is column major and starts in the top right with 48LEDS per column and 24 rows in a ZIGZAG pattern.
The code below is suppose to light the first three leds in Row 0 i.e (O,0; 0,1; 0,2) instead I get (0,0; 1,0; 2,0)
#include <Adafruit_NeoPixel.h>
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <gamma.h>
#include "RGB.h"
#define PIN 5
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(48, 24, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);
void setup() {
matrix.begin();
matrix.setBrightness(30);
matrix.setTextColor( matrix.Color(255, 255, 255) );
matrix.setTextWrap(false);
}
// RGB values from 0-255
//Color(uint8_t r, uint8_t g, uint8_t b);
void loop() {
matrix.drawPixel(0, 0, matrix.Color(red.r, red.g, red.b));
matrix.drawPixel(0, 1, matrix.Color(red.r, red.g, red.b));
matrix.drawPixel(0, 2, matrix.Color(red.r, red.g, red.b));
matrix.show();
}