GPS

Module NameGps
Import NameGps

IsRMCAvailable

Function IsRMCAvailable(ByRef sentence As String) As Boolean
  • sentence - the NMEA sentence, if the function returns true. It is important to ensure that the length of the string value passed is large enough to accommodate the full NMEA sentence.

Check to see if an RMC sentence is available. Returns true if found, false otherwise.

IsGGAAvailable

 Function IsGGAAvailable(ByRef sentence As String) As Boolean
  • sentence - the NMEA sentence, if the function returns true. It is important to ensure that the length of the string value passed is large enough to accommodate the full NMEA sentence.

Check to see if a GGA sentence is available. Returns true if found, false otherwise.

Start

 Sub Start()

Start interrupt handling.

Halt

 Sub Halt()

Stop interrupt handling

Reset

 Sub Reset()

Reset the module. A call to Halt() should be made before making a call to this routine.

ConvertToWGS84

 Function ConvertToWGS84(strValue As String, bearing As Char) As String
  • strValue - the latitude or longitude value to convert, as returned by the GPS module.
  • bearing - the latitude or longitude bearing (N, S, E or W), as returned by the GPS module.

Most mapping software (for example, google maps) require the latitude and longitude in WGS84 format. This routine converts a NMEA string value into a WGS84 string value. For example:

Dim lng As String
if Gps.GetField(rmc, 4, data) And Gps.GetField(rmc, 5, bearing) Then 
   lng = Gps.ConvertToWGS84(data, bearing(0))
End If

GetField

 Function GetField(ByRef sentence As String, index As Byte, ByRef field As String) As Boolean  
  • sentence - the NMEA sentence.
  • index - the index of the field you want to return. The first field index starts at 0, the second at index 1 and so on.
  • field - the field value, if the function returns true.

Find a field from within the NMEA sentence. Returns true if a field found, false otherwise.

PowerUp

 Sub PowerUp()

Power up the GPS module.

PowerDown

 Sub Reset()

Power down the GPS module.