I tried setting the first value of the char array to 0 it didn't work i got the second number continued by the first number.
Because you are not adding data to the array correctly.
This is an example of how it should be done:
char inData[15];
byte index = 0;
inData[index] = '\0';
while(Serial.available() > 0)
{
char aChar = Serial.read();
if(aChar == ",")
{
// Use the index characters in inData
// Get ready for next value
index = 0;
inData[index] = '\0';
}
else
{
inData[index++] = aChar; // Add the char to the array
inData[index}; // Add a NULL after that character
}
}
String input_line [50];
Wow. Talk about a sledge-hammer solution...