I've got a problem with displaying longitude and latitude on the Arduino TFT.
After converting the coordinates to char, the TFT only shows the first seven signs (e.g.: 4251.01).
The Rest is missing. I'm using text size 1.
Below is the code I'm using.
char latitude_c[15];
char latitude[15];
char longitude_c[15];
char longitude[15];
char lat_c[4];
char lat[4];
char lon_c[4];
char lon[4];///////Position
void loop()
{
if (GPS.fix) {
String latitude_b =String(GPS.latitude);
latitude_b.toCharArray(latitude_c,15);// convert the reading to a char array
String longitude_b = String(GPS.longitude);
longitude_b.toCharArray(longitude_c,15);// convert the reading to a char array
String lat_b = String(GPS.lat);
lat_b.toCharArray(lat_c, 4);// convert the reading to a char array
String lon_b = String(GPS.lon);
lon_b.toCharArray(lon_c, 4);// convert the reading to a char array
TFTscreen.stroke(0,0,0);
TFTscreen.text(longitude,70,66);
TFTscreen.text(latitude,70,79);
TFTscreen.text(lon,110,66);
TFTscreen.text(lat,110,79);
TFTscreen.stroke(255,255,255);
TFTscreen.text("Location:",3,53);
TFTscreen.text("Latitude:",7,66); TFTscreen.text(latitude_c,70,66);TFTscreen.text(lat_c,135,66);
TFTscreen.text("Longitude:",7,79); TFTscreen.text(longitude_c,70,79);TFTscreen.text(lon_c,135,79);
latitude_b.toCharArray(latitude,15);// convert the reading to a char array
longitude_b.toCharArray(longitude,15);// convert the reading to a char array
lat_b.toCharArray(lat, 4);// convert the reading to a char array
lon_b.toCharArray(lon, 4);// convert the reading to a char array
Thaks for help.