Hi, I had to leave the project aside for a time, but I'm now into this again. I understand the code and how to make it work, but I have some questions:
Why do you divide by 64? Doesn't that implies that I'm decreasing the resolution? I understand that the ASCII table is limited, but I have, for example, 90 symbols from "$" to "~", shouldn't I try that resolution instead? (And use maybe "!" and "#" as start and end markers?)
EDIT: correct me if I'm wrong, but the decoding part of the code shouldn't be?:
myNumber = (((highByte - 48)*100) + (lowByte - 48)) / 100 * 64
And my final question is how do I separate the two symbols into highByte and lowByte?
Currently I'm sending, for example:
<A1 0f 47 ... Xi N5>
My Arduino code can detect that the values are between spaces, and it used to process those values with atoi(), but now I have to also separate the two symbols' values and store them on highByte and lowByte. I don't know how to do that.
This is the fragment of my code I should be modifying:
char * token = strtok(receivedChars," ");
while (token != NULL){
int aNum = atoi(token);
if(arrIndex <= 134){
//arrayOfNums[arrIndex] = aNum;
tlc.setPWM(arrIndex, aNum);
arrIndex++;
}
token = strtok (NULL, " ");
}