I see you started with String and gave up.
Try looking at these examples of reading Strings from Serial. Arduino Software Solutions
Using Strings avoids the memory and count issues discussed above.
void setup() {
Serial.begin(9600);
Serial.setTimeout(5); // at 9600 get about 1char/1mS so when reading user input from Arduino IDE monitor can set this short timeout
for (int i = 10; i > 0; i--) {
Serial.print(' '); Serial.print(i);
delay(500);
}
Serial.println();
Serial.println(F("SerialReadString.ino"));
}
void processInput() {
if (Serial.available()) { // skip readString timeout if nothing to read
String input = Serial.readString();
input.trim(); // strip off any leading/trailing space and \r \n
if (input.length() > 0) { // got some input handle it
Serial.print(F(" got a some input '")); Serial.print(input); Serial.println("'");
// parse input here and set globals with results
}
}
}
void loop() {
processInput(); // handle the Serial in this task
// other tasks here
}
Having said that, you should take the time to understand how to define and access arrays (char or otherwise)
char *rxData[ ]={0};
is mixing a lot of stuff in that statement you are actually defining a array of (char *) of length 1 and setting the pointer to 0. (NULL) What I think you need is an array of (char) of length 10 (or 11)
try
size_t MAX_COUNT = 10;
char rxData[MAX_COUNT]; // allocate memory for 10 chars in an array called rxData
char rxData[MAX_COUNT] = {0}; // allocate memory for 10 chars in an array called rxData and set first location rxData[0] to 0
And
for(int a=0; a<11; a++){
rxData[a] = NULL;
}
for a size 10 array the count goes from 0 to 9 so a<11 should be a<10.
However perhaps you where trying to allocate a c-string of size 10 that is 10 chars and a terminating '\0' => array size 11
If that was the case then you need
char rxData[MAX_COUNT+1];
and not forget to add the '\0' after the data has been read.
Finally
rxData[count] = Serial.read();
count++;
does not limit how big count can get. So after 10 reads you will start writing outside the allocated memory for the array and the sketch will most likely just crash
As I said using String avoids all this BUT... you still need to understand arrays.