I cant make it work...
Maybe something Im not taking into account. Im sending via serial "5 s" or "5 f".
Does data is transfered in ASCII ?
So, in Parse the number is coverted into an integer but wount the letter be coverted too?
Sorry for my lack of knoledge. Im not a programmer im trying to build a controller for a synth
Can you spot the mistake?
unsigned long s = 0x006600;
unsigned long f = 0x000000;
char color;
int a ;
/////////
void parseData() {
char * strtokIndx;
strtokIndx = strtok(tempChars," ");
a = atoi(strtokIndx);
strtokIndx = strtok(NULL, " ");
switch( strtokIndx[1] )
{
case 's' :
{
color = s;
break;
}
case 'f' :
{
color = f;
break;
}
default :
{
color = f;
break;
}
}
trellis.setPixelColor(a, color);