I'm trying to program a little bit in Arduino, but I'm stuck with probably something trivial.
This is what I have:
char ang[3], lat[9];
dtostrf(GPS.angle, 3, 0, ang);
dtostrf(GPS.latitude, 9,5, lat);
Serial.println(lat);
Serial.println(ang);
Serial.println("-------");
I would expect the following in the serial monitor:
5111.60160
267
-------
But instead, I'm getting this:
5111.60160
2675111.60160
-------
So it looks like the ang
holds both the angle and the latitude....
Why is this happening? And how can I solve this?
My goal is to make one big string, comma separated, from the data stored in GPS
\0
ang[3] = '\0';