Bear with me, as this is only my second-ever Arduino project.
This is going to be a Christmas Countdown scroller using an Uno and 4 16x16 NeoMatrix tiles in a 2x2 configuration. The code below works, but as soon as I change tilesY to 2, it updates the code and whatever was happening stops and will only start scrolling again if I change tilesY back to 1.
It appears to be connected properly between DIN and DOUT on the backs of the matrices. Also, the other side will light up the unlit side of the 2x2 square is connected directly to the Uno's 5V port.
The documentation says that tilesX should be the number of matrices wide, and tilesY is the height. Any ideas?
Thanks!
Blair
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Time.h>
#define PIN 4
#define matrixWidth 16
#define matrixHeight 16
#define tilesX 2
#define tilesY 1
//How many days until Christmas?
int RGBPulseSpeed = 1; //speed at which the text color will change. Keep below 10 to start
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(matrixWidth,matrixHeight, tilesX, tilesY, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG +
NEO_TILE_TOP + NEO_TILE_RIGHT + NEO_TILE_ROWS,
NEO_GRB + NEO_KHZ800);
const uint16_t colors[] = {
matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(5);
matrix.setTextColor(colors[0]);
}
int x = matrix.width();
int pass = 0;
void loop() {
matrix.fillScreen(255);
matrix.setCursor(x, 0);
matrix.print(F("Days 'til Christmas"));
if(--x < -36) {
x = matrix.width();
if(++pass >= 3) pass = 0;
matrix.setTextColor(colors[pass]);
}
matrix.show();
delay(100);
}