more OctoWS2811 and scrolling text

As promised, here is the code for getting the characters entered as text in the sketch, having the sketch look these up in the alphabet array, grab the hex values and the push these onto the array in the first column. The array then copies and moves this first column by one place and adds in the next column of values.

////Start of message setup////
char msg[] = "Hi, this is a test for OctoWS2811. Scrolling text using a character lookup table for alphabet. # $ @ * etc... ";

for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++) //start of charIndex setup
{
int alphabetIndex = msg[charIndex]- ' ';
if (alphabetIndex < 0) alphabetIndex=0;
bool isOn =0;
for (int col=0; col<6;col++) {
//////////START OF SET METHOD/////////////////
for(int row=0; row<rows ;row++){
if (col<5) isOn = bitRead( alphabets[alphabetIndex][col], row ) == 1;
leds.setPixel(pix[row],isOn*50);
leds.show();delay(del);
}
///////////START OF THE SCROLL METHOD/////////////////////
for(int a=0; a<8; a++){
for(int b=1; b<34;b++){
leds.setPixel(array[a][b]-1,leds.getPixel(array[a][b]));}
}
////////END OF SET AND SCROLL////////////////////
}
}//end of char index setup
}//end of message setup

In the above, the array being referenced for indexed values is called alphabets, and this should be provided as:

byte alphabets [96] [5] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, // space (0x20)
{ 0x00, 0x00, 0x2F, 0x00, 0x00 }, // !
{ 0x00, 0x07, 0x00, 0x07, 0x00 }, // " ....etc

The code uses some values which are defined at the start:

//fixed values for led array script
int rows = 8;
int cols = 7;
int pix[8] = {33,67,101,135,169,203,237,271};
int del = 6;

the pix value is just used to tell teensy where to put the values taken from the alphabet array.

hope that you find this useful

mortonkopf