Hi there,
I’m trying to chain multiple neopixel panels together to create a RSS feed with code flashed to my Adriano nano, pushed via usb from my Raspberry Pi.. I’ve already verified I have my configuration correct for the matrixes and the tile format via the “Howdy” example provided in the neomatrix library.
However when I try to implement this same configuration to the code I am working with, I get no results on either panel. If I set the configuration back to a single panel, life is good, so I’m obviously missing something here.
The source code provided was intended to run on (3) chained 8x8 matrices, and I believe that may be part of the problem.
I owe anyone that can help me with a bucketload of thanks, since this little Christmas project has become quite overwhelming!
Here is the code I’m trying to run, with (2) 8x32 matrices chained together:
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, 2, 1, PIN,
NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_ROWS + NEO_TILE_PROGRESSIVE +
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);
const uint16_t colors[] = {
matrix.Color(250, 0, 0)};
const byte numChars = 128;
char receivedChars[numChars]; // an array to store the received data
boolean newData = false;
String data;
int x = matrix.width();
void setup() {
Serial.begin(9600);
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(40);
matrix.setTextColor(colors[0]);
matrix.fillScreen(0);
matrix.show();
}
void loop() {
recvWithEndMarker();
showNewData();
}
void recvWithEndMarker() {
static byte ndx = 0;
char endMarker = '\n';
char rc;
while (Serial.available() > 0 && newData == false) {
rc = Serial.read();
if (rc != endMarker) {
receivedChars[ndx] = rc;
ndx++;
if (ndx >= numChars) {
ndx = numChars - 1;
}
}
else {
receivedChars[ndx] = '\0'; // terminate the string
ndx = 0;
newData = true;
}
}
}
void scroll(String text){
//scrolling text
matrix.setTextColor(colors[0]);
int len = text.length();
for(int i=24;i>(len*(-6));i--){
matrix.fillScreen(0);
matrix.setCursor(i, 0);
matrix.print(text);
matrix.show();
delay(30);
}
}
void showNewData() {
if (newData == true) {
Serial.print("Just received: ");
Serial.println(receivedChars);
data = receivedChars;
newData = false;
scroll(data);
}
}