NEO6MV2 GPS / LEA 6H

Hi,

I just got a GY-NEO6MV2 GPS module from online shop but not exactly the original one but a LEA 6H as i done a research.

Well i searched on Internet how to use it and i found this website topic :

http://arduinostuff.blogspot.com/2014/05/neo6mv2-gps-module-with-arduino-uno-how.html

I installed the TinyGPS Library on my arduino IDE plugged the wires as in the website picture + resistors and I'm testing the ( TinyGPS / test_with_gps) example.

I got my GPS module on the window so the module could recieve data, I waited about 10min but i got only this :

Sats HDOP Latitude  Longitude  Fix  Date       Time     Date Alt    Course Speed Card  Distance Course Card  Chars Sentences Checksum
          (deg)     (deg)      Age                      Age  (m)    --- from GPS ----  ---- to London  ----  RX    RX        Fail
-------------------------------------------------------------------------------------------------------------------------------------
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   0     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   1     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   3     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   4     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   4     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   6     0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   11    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   16    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   18    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   20    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   20    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   20    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   22    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   22    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   23    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   25    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   34    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   39    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   49    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   51    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   51    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   54    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   54    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   57    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   57    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   57    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   58    0         0        
**** **** ********* ********** **** ********** ******** **** ****** ****** ***** ***   *******  ****** ***   58    0         0

So could someone tell me what could be the problem that i don't get any kind of data from the GPS ? I know that the GPS start getting data outside, the module is 10cm from a window that's the max i could put it from my PC. I waited 30min but still the same data.

Verify that the baudrate is correct. Just dump the GPS-read to a serial write.
(often they are setup for 9600 of 4800 baud)

Have u switched RX/TX ?

#include <SoftwareSerial.h>

SoftwareSerial mySerial(4,3); // RX, TX

void setup()  
{
  Serial.begin(57600);
  mySerial.begin(8600); // or other speed
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
}

I changed too 9600, what do you mean if i have changed the rx/tx ?

The GPS Tx pin should be connected to the Rx pin on the Arduino.

For the example sketch posted earlier, like this

GPS Tx —> pin4 Arduino, mySerial Rx

GPS Rx <— pin3 Arduino, mySerial Tx

I changed it’s working, i just changed from the code the pinds position but still got a problem.

I got the data and i try to put them on a OLED 128x64 the problem is that i can’t understand how can i take the value of the lat, log and put it on the OLED.

Code :

#include <SoftwareSerial.h>

#include <TinyGPS.h>

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif
/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(3, 4);

static void smartdelay(unsigned long ms);
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  /*
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.println("Sats HDOP Latitude  Longitude  Fix  Date       Time     Date Alt    Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)     (deg)      Age                      Age  (m)    --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("-------------------------------------------------------------------------------------------------------------------------------------");
*/
  ss.begin(9600);
}
int i;
void loop()
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const double LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  /*
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 11, 6);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  print_date(gps);
  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 7, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0xFFFFFFFF : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? TinyGPS::GPS_INVALID_F_ANGLE : TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);
*/
  gps.stats(&chars, &sentences, &failed); 
  print_int(chars, 0xFFFFFFFF, 6);
/*  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);*/
  //Serial.println();

  smartdelay(1000);
  
  display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.print("Data: ");
    display.println(chars);

    
      display.setTextSize(1);
    display.setTextColor(WHITE);
 
    display.print("Loop: ");
    display.println(i);
    
    display.display();
    //delay(1000);
    i++;
    display.clearDisplay();
    
}

static void smartdelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

static void print_float(float val, float invalid, int len, int prec)
{
  if (val == invalid)
  {
    while (len-- > 1)
      Serial.print('*');
    Serial.print(' ');
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1); // . and -
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(' ');
  }
  smartdelay(0);
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  smartdelay(0);
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("********** ******** ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  smartdelay(0);
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  smartdelay(0);
}

I got this code trying to put the chart of the GPS on the OLED it’s working but after 8~ 20 loops the loop stop looping xD, and a 2nd problem is that how i take the value of the lat, log or any value from GPS to
print in on the OLED.

Hi

I know i posted the same on this topic but i thought that would be off topic and i made new one.

So my problem is:

I got GPS data which I wanna print them on a OLED but after few loops or printing on the OLED
the loop stops.

My code that im working with :

#include <SoftwareSerial.h>

#include <TinyGPS.h>

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif
/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(3, 4);

static void smartdelay(unsigned long ms);
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  /*
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.println("Sats HDOP Latitude  Longitude  Fix  Date       Time     Date Alt    Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)     (deg)      Age                      Age  (m)    --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("-------------------------------------------------------------------------------------------------------------------------------------");
*/
  ss.begin(9600);
}
int i;
void loop()
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const double LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  /*
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 11, 6);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  print_date(gps);
  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 7, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0xFFFFFFFF : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? TinyGPS::GPS_INVALID_F_ANGLE : TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);
*/
  gps.stats(&chars, &sentences, &failed); 
  print_int(chars, 0xFFFFFFFF, 6);
/*  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);*/
  //Serial.println();

  smartdelay(1000);
  
  display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.print("Data: ");
    display.println(chars);

    
      display.setTextSize(1);
    display.setTextColor(WHITE);
 
    display.print("Loop: ");
    display.println(i);
    
    display.display();
    //delay(1000);
    i++;
    display.clearDisplay();
    
}

static void smartdelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

static void print_float(float val, float invalid, int len, int prec)
{
  if (val == invalid)
  {
    while (len-- > 1)
      Serial.print('*');
    Serial.print(' ');
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1); // . and -
    flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(' ');
  }
  smartdelay(0);
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len > 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  smartdelay(0);
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("********** ******** ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  smartdelay(0);
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  smartdelay(0);
}

Look in the loop section the rest doesn’t mater.

What i got is the chart from the GPS printed on the OLED after 8~20 loops the loop stops working.
My 2nd problem is how im gonna take the value from the GPS like log, lat, alt,…etc and print them on the OLED. It need an exact value, i tried what i could but it’s not working.

As you see the chart is just a value but the Latitude it’s a array of code and it’s not working the same
for the OLED print.

any help ?

Out of RAM?

Our of ram? How could be out of ram? i just print a single value.

Presumably, your display buffer takes 1kB of RAM, then there’s the line buffer for GPS, all those strings. . .
Add them up - do the arithmetic.

I take only one value from the GPS, i don't take all of them, how could the ram fill up? i clean the oled every loop. maybe you don't know what your talking or you don't understand.

You're right - I don't know what I'm talking/writing about - I've only been programming for forty years.

I'll leave your thread now.

Are you sure your print_int function correctly terminates the sz[] array in ALL cases?

That I can not immediately see that sz[] is always terminated, is a good indication the function is overly complicated. Maybe you need to simplify it.

the print_int is not mine, it's from adafruit library gps example, the only thing i changed is the oled code in the loop.

What i wanna do its just to simplify the value and work easy with them like x=lat..etc x values what i see in this example is a array of value that i can't read as a simple code and use it on the OLED.

Could be nice if i got a little help and explanation.

and AWOL it's your choise to help or not

Thanks for the clarification. I'll keep it in mind

Domino60: the only thing i changed is the oled code in the loop.

Start there then. Get something simple working first. Create a new sketch. Add just enough code to print some some static text and a counter on the OLED. When you have that working without crashing, you can pul data from the GPS and print that instead of the counter.

What i wanna do its just to simplify the value and work easy with them like x=lat..etc x values what i see in this example is a array of value that i can't read as a simple code and use it on the OLED.

A GPS uses an 'array' of satellites to triangulate a single position on the ground.

I don't use tinyGPS but according to the documentation,

long lat, lon;

// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);

Could be nice if i got a little help and explanation.

:Bites lip(!)

Start there then. Get something simple working first. Create a new sketch. Add just enough code to print some some static text and a counter on the OLED. When you have that working without crashing, you can pul data from the GPS and print that instead of the counter.

I already worked with the OLED and got text on it, got 8 values looping without problem for more than half+ hour tested and confirmed.

After i got the GPS code and added the necessary code to print on the OLED, I'm not sure what's the problem and my OLED stop working after few loops with the GPS code.

According to the code:

void loop()
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const double LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  /*
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 11, 6);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  print_date(gps);
  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 7, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0xFFFFFFFF : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? TinyGPS::GPS_INVALID_F_ANGLE : TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);
*/
  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
/*  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);*/
  //Serial.println();

  smartdelay(1000);
  
  display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.print("Data: ");
    display.println(chars);

    
      display.setTextSize(1);
    display.setTextColor(WHITE);

    display.print("Loop: ");
    display.println(i);
    
    display.display();
    //delay(1000);
    i++;
    display.clearDisplay();
    
}

To print a value from the gps i need to make the gps to write it 1st in the serial monitor and after that to copy it on the OLED. About the values:

gps.f_get_position(&flat, &flon, &age);

I get like that :

...
  display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.print("Latitude: ");
    display.println(flat);
...

But i get on my OLED only " Latitude: 0.00" even if the GPS get the latitude.

If i could only get this :

 print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 10, 6);

and put it on the OLED, I tried :

...
  display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.print("Latitude: ");
    display.println(flat, TinyGPS::GPS_INVALID_F_ANGLE);
...

But like that i get on OLED 00.00000000000000000000000000000000000000000000000000000000 and no real data.

I keep trying but still nothing.

ps (I just got the GPS few days ago)

Found the problem probably AWOL was right not sure :D I had serial monitor and OLED in the same time after few sec the OLED and serial crashed.

I got off the serial and used only the OLED and had in the code only values printed only on OLED and working.

Perfect.

Domino60: Found the problem probably AWOL was right not sure

I got something right? Imagine that.

Well yea, probably the ram got full while loading print on serial and oled so after few sec crashed. I changed the code and printed on oled only and worked really well.