case 'R': {
char resolution[12] = {'\0'}; // no "R"
for (int i = 0 ;Serial.available() > 0 ;i++ ){
resolution[i] = Serial.read();
}
Serial.println(resolution);
// tab in [5]
resolution[5] = '\0';
resolution[11] = '\0';
for (int x = 0;x<11;x++){
Serial.println(resolution[x], BYTE);
}
DECSteps = atoi((char*)resolution);
RASteps = atoi((char*)(resolution[6]));
Serial.println(DECSteps); //debug out
Serial.println(RASteps); //debug out
//respond to command
Serial.write("R");
Serial.flush(); // one can never be too sure...
break;
On an input of "R12345x67890" I get:
number of characters in buffer:1
12345x67890
1
2
3
4
5
null
6
7
8
9
0
12345
0
R