im just stuck on figuring out how to store the incoming data from the phone into a string.
Easy. Like so:
char inData[24]; // Use whatever size you need
byte index = 0;
void loop()
{
while(Serial.available() > 0)
{
char inChar = Serial.read();
if(index < 22)
{
inData[index++] = inChar;
inData[index] = '\0';
}
}
// Use the data in inData, then reset
inData[0] = '\0';
index = 0;
}
Of course, then you'll run into the issue where the whole packet does not arrive all at once. Then, you'll need to add start and end of packet markers, and properly read the data. I regularly post how to do that. Search for "started && ended".