Led Matrix control using UDP and MaxMatrix

This program listens for a packet in the following format:

0 - 2 indexes are the speed the text should print
3 - index is a 0 or 1 and its just telling whether it should scroll the text or just have it static
4-100 is the actual text to print

All of this is sent, via a simple java program I made, in one packet.

The Arduino code listens for that packet and when it gets it, it basically has to pull out the first four indexes and the just have the rest to print.

My problem is I don't know how to specify a range of indexes from an array, as you can see from what I've been doing in my code to solve that problem, it's not very efficient. Any suggestions would be appreciated.

MAX7219_5_UDPwithOPTIONS.ino (12.9 KB)

MAX7219_5_UDPwithOPTIONS.ino (10.7 KB)

Making Strings of individual characters is stupid. Assigning elements of the array to individual characters is rather pointless.

My problem is I don't know how to specify a range of indexes from an array

Cite a specific example of what you want to be able to do. Something like "I need the characters in positions 9 to 14 to be in a string called tweedleDee".

Ok.

In this section of the code it prints out the packetBuffer, which is a char*, as scrolling text or static text to the matrix.

if(d2==0)
  {
    printStringWithShift(packetBuffer, speed2);

  }
  
  else
  {
    printString(packetBuffer);
  }

I what it to only print that the elements of that array from 4-100

Also I attached the original code before I tried pulling out all the elements of the array and printing them out individually.

packetBuffer is a pointer to the 0th element of the array. &packetBuffer[3] is a pointer to the 3rd element of the array.

If I try to use packBuffer[3], it gives me a compiler error saying "invalid conversion from 'char' to 'char*'" because if you look lower in the code that method uses a char*

printStringWithShift(packetBuffer[3], speed2);
void printStringWithShift(char* s, int shift_speed){
  while (*s != 0){
    printCharWithShift(*s, shift_speed);
    s++;
  }
}