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.
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".
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++;
}
}