bluetooth data parse question

Hi all!

I am trying to send lat and long values from my phone into my arduino via an hm-10.
The plan is to text something like this from my phone

47.234235,-78.235111

And the arduino stores two values

value1=47.234235
value2=-78.235111

but I am getting tripped up on formats char, char*, String, int coming from the hm-10 bluetooth module.

if you uncomment the line and then comment the line above it, the code runs perfectly-its just a problem when the values come from the hm-10.

Please help!

thank you,
Mike

#include <SoftwareSerial.h>
#include <string.h>
int bluetoothTx = 2; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3; // RX-I pin of bluetooth mate, Arduino D3
char *Lat, *Long;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
String readString;

void setup() {
Serial.begin(9600);
bluetooth.begin(115200);
delay(100);
bluetooth.println("U,9600,N");
bluetooth.begin(9600);
}

void loop() {
while(bluetooth.available())
{
delay(10);
char c = bluetooth.read();
if (c == ',') {
break;
}
readString += c;
}

if (readString.length() >0) {

char *test=readString;
//char *test="47.234235,-78.235111";
Lat = strtok(test,":");
Long = strtok(NULL,":");

Serial.print(Lat);
Serial.println("");
Serial.print(Long);
readString="";
}
}

apologies, instead of texting

47.234235,-78.235111

I will actually be texting

47.234235:-78.235111

with the colon not the comma

     char *test=readString;

What is this rubbish? Making a char pointer point to something that is not a char array makes no sense.

Why do you think you need to use a String to store the incoming data?

Robin2 has a great tutorial on reading and parsing Serial data.

http://forum.arduino.cc/index.php?topic=396450.0
Nary a stupid String in sight.

Thank you, Robin2's tutorial was exactly what I was looking for!

Mike