51 digitalWrite(
LEDPIN, HIGH);
52 char * tok = strtok(
instr,
" \r\n");
53 int state = 0;
int targx = 0, targy = 0;
71 if (strcmp(tok,
"T2") == 0) state = 1;
72 else if (strcmp(tok,
"T1") == 0) state = 4;
73 else if (strcmp(tok,
"PANGAIN") == 0) state = 6;
74 else if (strcmp(tok,
"TILTGAIN") == 0) state = 8;
78 case 1: targx = atoi(tok); state = 2;
break;
79 case 2: targy = atoi(tok); state = 3;
break;
80 case 4: targx = atoi(tok); state = 5;
break;
81 case 6:
pangain = atoi(tok); state = 7;
break;
82 case 8:
tiltgain = atoi(tok); state = 9;
break;
85 tok = strtok(0,
" \r\n");
89 if (state == 3 || state == 5)