GPS module

Hello,

I'm Fairly new to Programming and for my school project we have to get the Lat and Long data from a GPS tracker while programming this the arduino IDE didn't give me a error message but the serial monitor doesn't show any of the data i want to have ,

Can somebody with a bit more knowledge help me?

#include <gp20u7.h>
#include <SoftwareSerial.h>


GP20U7 gps = GP20U7(Serial);

SoftwareSerial gpsSerial(8, 9); // RX, TX


Geolocation currentLocation;

void setup() {
  // Start de GPS module
  gps.begin();
}

void loop() {

  if(gps.read()){
    currentLocation = gps.getGeolocation();
    Serial.println("Your current location is:");
    Serial.print("    Latitude: ");
    Serial.println(currentLocation.latitude,5);
    Serial.print("    Longitude: ");
    Serial.println(currentLocation.longitude,5);
  }
}

Did you forget Serial.begin() ?

i think i did, but where in the code should i put it to recieve the data?

Where did you put it in all your other sketches?

SoftwareSerial gpsSerial(8, 9); // RX, TX
GP20U7 gps = GP20U7(gpsSerial);

Geolocation currentLocation;

void setup()
{
  Serial.begin(9600);
  gpsSerial.begin(9600);

  // Start de GPS module
  gps.begin();
}

Are you familiar with gp20u7 library? (if not, you should maybe use TinyGPS library, lots of code samples out there)
What is Geolocation class? Don't you need to include the header for it too?

I'm not familiar with anything GPS related or for that even arduino related. i tried tinygps in at first but struggeled with the same issues.

florinc:

SoftwareSerial gpsSerial(8, 9); // RX, TX

GP20U7 gps = GP20U7(gpsSerial);

Geolocation currentLocation;

void setup()
{
  Serial.begin(9600);
  gpsSerial.begin(9600);

// Start de GPS module
  gps.begin();
}




Are you familiar with gp20u7 library? (if not, you should maybe use TinyGPS library, lots of code samples out there)
What is Geolocation class? Don't you need to include the header for it too?

I tried the Serial.begin like you said but the serial monitor doesn't get any data in it. also you said something about the geolocation but i dont understand what you mean. With TinyGPS i had the same issue but is it easier to work with?

Read and follow this tutorial:
https://learn.sparkfun.com/tutorials/gps-shield-hookup-guide
Your GPS module should work similar to the one in the article.

I tried the Serial.begin like you said but the serial monitor doesn't get any data in it

Try printing a message in setup() after doing the Serial.begin(). Do you see the message in the Serial monitor ?

UKHeliBob:
Try printing a message in setup() after doing the Serial.begin(). Do you see the message in the Serial monitor ?

After trying to put in Serial.print("test message"); the only thing i see in the serial monitor is te

Xcited:
After trying to put in Serial.print("test message"); the only thing i see in the serial monitor is te

So, something is halting the processor before the interrupts get done shifting the data out. Add a Serial.flush() call after the Serial.print() call, and you'll see the complete message.

That won't help with the halting problem.

PaulS:
So, something is halting the processor before the interrupts get done shifting the data out. Add a Serial.flush() call after the Serial.print() call, and you'll see the complete message.

That won't help with the halting problem.

this doesn't help getting the full message, i dont know if any of you have experience with GPS modules but im using the GP-20u7 model and it only has 3 wires attached to it the Vcc for the 3.3 volt the TX and the GND. but the link i got earlier has a TX and RX wire and in the code its also given an int. how should i look at it with this module?

If the module doesn't have a RX wire, that means that you can't write to it. So, you can't change its baud rate or what sentences it reports.

Do you need to?

Forget trying to do anything with the data, for now. Just connect the TX pin to some unused digital pin, create an instance of SoftwareSerial using that pin as the TX pin (and -1 as the RX pin), and read any data that comes in and output it using Serial.print().

Show us what you get.

Xcited:
After trying to put in Serial.print("test message"); the only thing i see in the serial monitor is te

For now, do not worry about the gps data as getting a proper print is more important.

Anyways, here is the code I use for an Adafruit Ultimate GPS. Perhaps it can help ou get your gps module working:

//arduino pro mini
//ttyUSB0
#include <AM2320.h>
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <Wire.h> // requried to run I2C SH1106
#include <U8glib.h>
#include <stdio.h> //for function sprintf
#include <MsTimer2.h>

//sensor front facing you left to right
//1 VDD, 2 SDA (A4), 3 GND, 4 SCL(A5)
AM2320 th;//INITIALIZE THE TEMPRETURE N HUMIDITY MODULE

//pin3 to GPS rx - yellow wire
//pin2 to GPS tx - orange wire
SoftwareSerial mySerial(3, 2);
Adafruit_GPS GPS(&mySerial);
//
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE); //128X64
//
float floatVbatt = 0.0;
////voltage reading taken from VIN is after protection circuit, thus the offset
//const float floatV_InOffSet = 0.80;
float BattPercent = 0;
byte byteBatteryPercentUpper = 0;
byte byteBatteryPercentLower = 0;


//**********************************************************************************

//***********************************************************************************
//delay variables
#define LED_BlinkInterval 1000
////must be volatile since the can be multiple accsccessors in different scopes
volatile int iLEDBlinkTicCount = 0; //counts milliseconds
#define VoltsInterval 7
bool bVoltsDone = false;
#define RefreshSH1106_Interval 6
#define UpdateDistanceInterval 4
bool bUDIdone = false;
////*************************************************************************************
//
bool bLED_On = false;
//
////*************************************************************************************
////OLED page variables
#define PageCount 2
byte bytePage = 0;
void PageOne(void);
void PageTwo(void);
void (*pages[])() = { PageOne, PageTwo } ;
bool bPageDone = false;
////****************************************
//
bool bRun = false;
#define TimingStartPin 12
#define TimingResetPin 9

byte tSecondCount = 0;
byte tMinuteCount = 0;
byte tHourCount = 0;
byte tDays = 0;
String sStartTime = "";
String sElasped = "";
String sEndTime = "";

long lGPS_Lat0 = 0;
long lGPS_Lon0 = 0;
int lDistance = 0;
#define DEGREE 6000000
#define DistaceResetPin 11
#define StartStopDistanceCounterPin 10

//byte byTemp = 77;

//float temp = 0.0;




//
//


void setup() {




  GPS.begin(9600);

  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); // has speed n altitude
  // Note you must send both commands below to change both the output rate (how often the position
  // is written to the serial line), and the position fix rate.
  // 1 Hz update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
  GPS.sendCommand(PMTK_API_SET_FIX_CTL_1HZ);
  //turn off antenna data being sent
  GPS.sendCommand("$PGCMD,33,0*6D/r/n");
  //speed threshold level
  //0/0.2/0.4/0.5/0.8/1.0/1.5/2.0 m/s
  //GPS.sendCommand("$PMTK397,0.2*3F/r/n");

  pinMode(LED_BUILTIN, OUTPUT);//blink LED at pin 13
  pinMode(TimingStartPin, INPUT); //start n stop timing
  //digitalWrite(byteTimingStartPin, LOW);//set state initial

  pinMode(DistaceResetPin, INPUT); //set reset distance traveled input pin
  digitalWrite(DistaceResetPin, LOW);//set state initial

  pinMode(StartStopDistanceCounterPin, INPUT); //start stop Timer
  pinMode(TimingResetPin, INPUT); //reset timer

  //  //set time on ms for overflow, each overflow causes xFunc, void w no parameters, to be called
  MsTimer2::set(1, GPSSIGNAL);
  //enable interrupt
  MsTimer2::start();
  //disable interrupt
  //MsTimer2::stop()

  Serial.begin(230400); //for IDE testing

  //set string buffer size
  sStartTime.reserve(10);
  sElasped.reserve(10);
  sEndTime.reserve(10);


}//end setup

//***************************************************************************************
//// Interrupt is called once a millisecond, does a data read so main loop can parse GPS data
//***************************************************************************************
void GPSSIGNAL()
{
  //cause a GPS data read so that the
  //if (GPS.newNMEAreceived())
  //can do its thing
  GPS.read();
  //this 1-ish ms count is used for timing of other routines
  iLEDBlinkTicCount++;
}
//*****************************************************************************************
//
//*****************************************************************************************
void loop() {

  //Serial.println(th.h);

  if (digitalRead(StartStopDistanceCounterPin) == 1)
  {
    StartStopDistanceCounter();
  }

  if (digitalRead(DistaceResetPin) == 1)
  {
    ResetDistanceCounter();
  }

  if (digitalRead(TimingStartPin) == 0)
  {

    if (bRun)
    {
      fHRS_End();
      bRun = false;
    }
  }
  if (digitalRead(TimingResetPin) == 0)
  {
    fResetElapsedTime();
  }
  //blnk LED on pin 13 on / off for 1ish seconds
  //increment other event counters
  if (iLEDBlinkTicCount >= LED_BlinkInterval)
  {
    if (bLED_On)
    {
      digitalWrite(LED_BUILTIN, LOW);
      bLED_On = false;
      // increments +1 every 1000 millisecond count
      tSecondCount++;
      iLEDBlinkTicCount = 0;
    }
    else
    {
      digitalWrite(LED_BUILTIN, HIGH);
      bLED_On = true;
      tSecondCount++;
      iLEDBlinkTicCount = 0;
    }
    if (bRun)
    {
      fHRS_Elapsed();
    }
    //built in led on pin 13 flashed on for ~1 sec / off for ~1 sec
  }//end led blink

  if ( (tSecondCount %  VoltsInterval) == 0 )
    // equals about once every 5 seconds
  {
    //Analog-Digital converter factor, 10 bits, is 5 volts / 1023
    //r1 = 100K / r2 = 10020k
    if (!bVoltsDone)
    {
      floatVbatt = (5.0 * analogRead(A1) / 1023) / 10020 * ((100000 + 10020));
      fBatteryPercentRemaingCharge();
      bVoltsDone = !bVoltsDone;
    }
  }
  else
  {
    if ( bVoltsDone )
    {
      bVoltsDone = !bVoltsDone;
    }
  }
  //leave this code alone!!!!!!!!!!!!!!!!!!!!!
  //query GPS: has a new complete chunk of data been received?
  if (GPS.newNMEAreceived())
  {
    //if received cause parse data
    if (!GPS.parse(GPS.lastNMEA()))
      //else exit routine
      return;
  }
  //  //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  //reset timer whiles timer-is running
  //timer starts all over
  if (digitalRead(TimingStartPin) == 1)
  {
    if (digitalRead(TimingResetPin) == 1)
    {
      if (bRun == false)
      {
        fDeclareStartTime();
        sEndTime = "";
        sElasped = "";
        bRun = true;
      }
    }
  }// end if (digitalRead(TimingStartPin) == 1)


  if (GPS.fix)
  {
    if (digitalRead(StartStopDistanceCounterPin) == 0)
    {
      if ( ( tSecondCount % UpdateDistanceInterval ) == 0 )
      {
        if (!bUDIdone)
        {
          fCalDistance();
          bUDIdone = !bUDIdone;
        }
      }
      else
      {
        if (bUDIdone)
        {
          bUDIdone = !bUDIdone;
        }
      }
    }
  }
  //display data
  if ( (tSecondCount % RefreshSH1106_Interval) == 0 )
  {
    //limit number of updates to 1X in a second
    if (bPageDone == false)
    {
      u8g.firstPage();
      do
      {
        (*pages[bytePage])();
      } while ( u8g.nextPage() );
      //byteSH1106_TicCount = 0;

      bytePage++;

      if (bytePage == PageCount)
      {
        bytePage = 0;
      }

    }
    bPageDone = true;
  }
  else
  {
    if (bPageDone)
    {
      bPageDone = false;
    }
  }
  //if timer is off need a way to reset seconds
  if (!bRun)
  {
    if (tSecondCount == 60)
    {

      tSecondCount = 0;
    }
  }




}//end void loop

Alright at this very moment i have started using TinyGPS, the code i currently have is as follows

#include <TinyGPS++.h>
#include <SoftwareSerial.h>


int RXPin = 2;
int TXPin = 3;


int GPSBaud = 4800;

TinyGPSPlus gps;
"
SoftwareSerial gpsSerial(RXPin, TXPin);

void setup()
{
  
  Serial.begin(9600);

  
  gpsSerial.begin(GPSBaud);

  Serial.println(F("DeviceExample.ino"));
  Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
  Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
}

void loop()
{
 
  while (gpsSerial.available() > 0)
    if (gps.encode(gpsSerial.read()))
      displayInfo();

  
  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected"));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date/Time: "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F(" "));
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(F(":"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(F(":"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(F("."));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.print(gps.time.centisecond());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.println();
}

what im getting now is " NO GPS DETECTED" While it is wired properly.

i got this code from this site : GPS Shield Hookup Guide - SparkFun Learn

myGPS code part 2

//********************************************************************
//
//********************************************************************
void fDeclareStartTime()
{
  //if gps does not have day value then skip
  if (GPS.day > 0)
  {
    char buf[25];
    sprintf(buf, "%02d/%02d %02d:%02d:%02d", GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.seconds);
    sStartTime = buf;
  }
}//end fDeclareStartTime()



void StartStopDistanceCounter()
{
  if (lGPS_Lat0 == 0)
  {
    //save starting lat n lon if needed
    lGPS_Lat0 = round(GPS.latitude * 100) * 60;
    lGPS_Lon0 = round(GPS.longitude * 100) * 60;

  }
}

void ResetDistanceCounter()
{

  //byteUpdateDistanceInterval = 0;
  lDistance = 0;
  lGPS_Lat0 = 0;
  lGPS_Lon0 = 0;
}//end  void SetResetDistanceCounter()


void fResetElapsedTime()
{
  sStartTime = "";
  sEndTime = "";
  sElasped = "";
  tDays = 0;
  tHourCount = 0;
  tMinuteCount = 0;
  //tSecondCount = 0;
  //bRun = true;

}//void fResetElapsedTime()

void fBatteryPercentRemaingCharge()
{

  byte V_BattNominal = 8;
  byte V_MinRange = 6; //volts is lowest recomemded operating voltage


  if (floatVbatt >= V_BattNominal)
  {
    BattPercent = 100.00;
    return;
  }
  else if (V_MinRange > floatVbatt)
  {
    BattPercent = 0.00;
    return;
  }
  else
  {
    BattPercent = ((floatVbatt - V_MinRange) * 100.0) / (V_BattNominal - V_MinRange);
  }

}// end fBatteryPercentRemaingCharge()
//
////////////////////// OLED Picture Loop Draw ///////////////////
//// if data to be displayed exceeds screen size Arduino may lock up
//// shown by intertnal LED stops blinking
//
void PageOne(void) {

  char buf[20];
  float f = 0.0;

  //(X,Y) X=left right, Y= up down

  u8g.setFont(u8g_font_5x8);

  u8g.drawStr( 0, 7, "BAT:");
  u8g.setPrintPos(22, 7); u8g.print(floatVbatt);
  u8g.drawStr(43, 7, "V" );
  u8g.drawStr( 50, 7, "%" );

  //r = sprintf(buf, "%d.%d", byteBatteryPercentUpper, byteBatteryPercentLower);
  //sprintf(buf, "%", floatBattPercent);
  u8g.setPrintPos(55, 7); u8g.print(BattPercent);
  //u8g.setPrintPos(55, 7); u8g.print(byteBatteryPercentUpper + ".");

  sprintf(buf, "UTC %02d:%02d:%02d", GPS.hour, GPS.minute, GPS.seconds);
  u8g.setPrintPos(0, 15); u8g.print(buf);

  u8g.drawStr(64, 15, "Fix: ");
  u8g.setPrintPos(85, 15); u8g.print(GPS.fix);
  sprintf(buf, "Date: %02d/%02d/%02d", GPS.day, GPS.month, GPS.year);
  u8g.setPrintPos(0, 23); u8g.print(buf);
  u8g.drawHLine(3, 26, 115);
  u8g.drawVLine(3, 26, 27);
  u8g.drawVLine(117, 26, 27);
  u8g.drawHLine(3, 52, 115);

  if (GPS.fix)
  {

    u8g.drawStr(0, 62, "Hdg:");
    u8g.setPrintPos(25, 62); u8g.print(GPS.angle);
    u8g.drawStr(91, 15, "^");
    u8g.setPrintPos(99, 15); u8g.print(GPS.satellites);

    u8g.drawStr(63, 62, "MPH:");
    if ((lDistance * 3.2808) >= 500)
      //>= 500 feet
    {
      //Knots-per-hour X 6076 (feet per Knot) = feet-per-hour
      //feet-per-hour / 5280 (feet per mile) = mph
      u8g.setPrintPos(83, 62); u8g.print(((GPS.speed * 6076) / 5280));
    }
    else
    {
      u8g.setPrintPos(83, 62); u8g.print(0.00);
    }

    //u8g.setFont(u8g_font_7x13);
    u8g.drawStr(7, 37, "Lat:");
    f = (GPS.latitude / 100);
    u8g.setPrintPos(35, 37); u8g.print(int(f));
    u8g.drawCircle(48, 32, 1,  U8G_DRAW_ALL);
    f = GPS.latitude - (int(f) * 100);
    u8g.setPrintPos(55, 37); u8g.print(f);
    u8g.setPrintPos(83, 37); u8g.print(GPS.lat);

    f = 0.0;
    u8g.drawStr(7, 48, "Lon:");
    f = (GPS.longitude / 100);
    u8g.setPrintPos(30, 48); u8g.print(int(f));
    u8g.drawCircle(48, 42, 1,  U8G_DRAW_ALL); // outer fixed circle
    f = GPS.longitude - (int(f) * 100);
    u8g.setPrintPos(55, 48); u8g.print(f);
    u8g.setPrintPos(83, 48); u8g.print(GPS.lon);



  }

}// void PageOne(void) end

Xcited:
what im getting now is " NO GPS DETECTED" While it is wired properly.

If your getting that then one of the following is likley, in order;

You have it wired wrong even if you assume you have it wired correctly.
The GPS baud rate your program is using is incorrect.
The GPS is faulty.
Your Arduino is faulty.

My GPS code part 3

void PageTwo(void)
{

  //Serial.println ( "PageTwo(void)");
  u8g.setFont(u8g_font_5x8);
  if (GPS.fix)
  {


    if (digitalRead(DistaceResetPin) == 1)
    {
      u8g.drawStr(40, 56, "R E S E T");
    }
    else
    {
      if (digitalRead(StartStopDistanceCounterPin) == 0)
      {
        u8g.drawStr(0, 56, "*Miles");
      }
      else
      {
        u8g.drawStr(0, 56, "Miles");
      }
      //meters to miles
      u8g.setPrintPos(40, 56); u8g.print((lDistance / 1609.344));
    }

    //GPS.altitude * 3.2808 - meters to feet
    u8g.drawStr(0, 33, "Alti:");
    u8g.setPrintPos(28, 33); u8g.print((GPS.altitude * 3.2808));


  }//if (GPS.fix)

  if (th.Read() == 0)
  {
    //2 = CRC failed
    //1 = Sensor offline
    //

    //Serial.println(th.t);

    u8g.drawStr(0, 41, "Temp C:");
    u8g.setPrintPos(37, 41); u8g.print(th.t); //read th.t in C
    u8g.drawStr(67, 41, "F:");
    u8g.setPrintPos(79, 41); u8g.print(((th.t * 9 / 5) + 32)); //read th.t in C convert to F
    u8g.drawStr(0, 49, "RH: ");
    u8g.setPrintPos(25, 49); u8g.print(th.h);//read th.h
    u8g.drawStr(51, 49, "%");

  }
  else
  {
    u8g.drawStr(0, 41, " Temp n Humidity Error ");
    u8g.setPrintPos(70, 41); u8g.print(th.Read()); //read th.t in C
  } // end (th.Read() == 0)


  if (digitalRead(TimingResetPin) == 1)
  {
    if (bRun)
    {

      u8g.drawStr(0, 7, "Start");
      u8g.setPrintPos(29, 7); u8g.print(sStartTime);
      u8g.drawStr(0, 15, "Run"); u8g.setPrintPos(30, 15); u8g.print(sElasped);
      u8g.drawStr(0, 23, "Stop");
    }
    else
    {
      Serial.print( "bRun ");
      Serial.println( bRun );
      u8g.drawStr(0, 7, "Start");
      u8g.setPrintPos(29, 7); u8g.print(sStartTime);
      u8g.drawStr(0, 15, "Run"); u8g.setPrintPos(30, 15); u8g.print(sElasped);
      u8g.drawStr(0, 23, "Stop"); u8g.setPrintPos(30, 23); u8g.print(sEndTime);
    }
  }
  else
  {
    u8g.drawStr(0, 7, "Start");
    u8g.drawStr(0, 15, "Run  R E S E T");
    u8g.drawStr(0, 23, "Stop");
  }

}//void PageTwo()
////****************************************************************************
////
////****************************************************************************
void fHRS_Elapsed()
{
  char buf[30];

  if (sStartTime.length() == 0)
  {
    fDeclareStartTime();
  }
  else
  {
    if (tSecondCount >= 60)
    {
      tSecondCount = 0;
      tMinuteCount = tMinuteCount + 1;
    }
    if (tMinuteCount >= 60)
    {
      tMinuteCount = 0;
      tHourCount = tHourCount + 1;
    }
    if (tHourCount >= 24)
    {
      tHourCount = 0;
      tDays = tDays + 1;
    }

    sprintf(buf, "%03d  %02d:%02d:%02d", tDays, tHourCount, tMinuteCount, tSecondCount);
    sElasped = buf;
    //Serial.println(sizeof(sElasped ));


  }
  return;
} //end SfHRS_Elapsed()
//*************************************************************************************
//
//*************************************************************************************
void fHRS_End()
{
  char buf[25];
  String r = "";

  r = sprintf(buf, "%02d/%02d %02d:%02d:%02d",  GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.seconds);
  sEndTime = buf;


  //Serial.print( "sEndTime " );
  //Serial.println( sEndTime.length() );
  //Serial.println(sizeof(sEndTime));


} //end String fHRS()

void fCalDistance()
{


  if (digitalRead(StartStopDistanceCounterPin) == 0)
  {
    //byteTemp = byteTemp + 1;

    //get lat lon values if lat is 0
    StartStopDistanceCounter();

    //doing the * 60 * 100 here is faster then using a function for the math
    long tempLat = round(GPS.latitude * 100) * 60;
    long tempLon = round(GPS.longitude * 100) * 60;
    //
    //add new distance to previous distance
    lDistance = lDistance + DistanceBetween(lGPS_Lat0, lGPS_Lon0, tempLat, tempLon);
    //reset to last used measuring point
    lGPS_Lat0 = tempLat;
    lGPS_Lon0 = tempLon;

    //Serial.println(round(GPS.latitude * 100));
    //Serial.println(round(GPS.latitude * 100) * 60);

    //Serial.println(round(GPS.longitude * 100));
    //Serial.println(round(GPS.longitude * 100) * 60);
    //Serial.println("");
  }

}// end void fCalDistance()
////****************************************************************************************
unsigned int CosFix (long angle)
{
  long u = labs(angle) >> 16;
  u = (u * u * 6086) >> 24;
  return 246 - u;
}

long Diff (long deg1, long deg2)
{
  long result = deg2 - deg1;
  if (result > 180 * DEGREE) return result - 360 * DEGREE;
  else if (result < -180 * DEGREE) return result + 360 * DEGREE;
  else return result;
}
//calculates distance between 2 points . using lat/lon. ignores earth curve
//valid for distances of several 100K
//returns meters
//www.technoblogy.com/show?LNQ
unsigned int DistanceBetween (long lat1, long long1, long lat2, long long2)
{
  long dx = (Diff(long2, long1) * CosFix((lat1 + lat2) / 2)) / 256;
  long dy = Diff(lat2, lat1);
  unsigned long adx = labs(dx);
  unsigned long ady = labs(dy);
  unsigned long b = max(adx, ady);
  unsigned long a = min(adx, ady);
  if (b == 0) return 0;
  return 95 * (b + (110 * a / b * a + 128) / 256) / 512;
}
////*****************************************************************************************
////long fDegreeToDecimal(float floatDegree)
////{
////  return floatDegree  * 60 * 1000;
////}
//
////Idahowalker 06-19-2018
////Developed on a Raspberry Pi 3B using Arduino 1.8.5 IDE

what im getting now is " NO GPS DETECTED" While it is wired properly.

That message is printed 5 seconds after the Arduino resets, after which you stuff your head in the sand.

Make loop() look like this. NOTHING more!

void loop()
{
   if(gpsSerial.available() > 0)
   {
      char c = gpsSerial.read();
      Serial.print(c);
   }
}

I made the void loop like that, and it doesn't return anything.