# GPS( )

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
GPS(option)
PRINT #GPS, string$

Description:

The GPS functions are used to return data from a serial communications channel opened as GPS.
GPS uses the $GNGGA, $GNRMC, $GPGGA and $GPRMC messages.

The function GPS(VALID) should be checked before any of these functions are used to ensure that the returned value is valid.

GPS(ALTITUDE) | Returns current altitude (if sentence GGA is enabled).
GPS(DATE) | Returns the normal date string corrected for local time e.g. “12-01-2020”.
GPS(DOP) | Returns DOP (dilution of precision) value (if sentence GGA is enabled). Low numbers are better.
GPS(FIX) | Returns 0=no fix, 1=fix, etc. if sentence GGA enabled
GPS(GEOID) | Returns the geoid-ellipsoid separation (if sentence GGA is enabled).
GPS(LATITUDE) | Returns the latitude in degrees as a floating point number, values are negative for South of equator
GPS LONGITUDE) | Returns the longitude in degrees as a floating point number, values are negative for West of the meridian.
GPS(SATELLITES) | Returns number of satellites in view (if sentence GGA is enabled).
GPS(SPEED) | Returns the ground speed in knots as a floating point number.
GPS(TIME) | Returns the normal time string corrected for local time e.g. “12:09:33”.
GPS(TRACK) | Returns the track over the ground (degrees true) as a floating point number.
GPS(VALID) | Returns: 0=invalid data, 1=valid data
PRINT #GPS, string$ | Outputs a NMEA string to an opened GPS device. The string must start with a $ character and end with a * character. The checksum is calculated automatically by the firmware and is appended to the string together with the carriage return and line feed characters.

OPEN "com1: 9600" AS GPS,10
DO
IF GPS(VALID) THEN
PRINT GPS(TIME), GPS(LATITUDE), GPS(LONGITUDE), GPS(ALTITUDE);
PRINT GPS(SATELLITES), GPS(DOP), GPS(FIX)
ELSE
PRINT GPS(SATELLITES), GPS(DOP), GPS(FIX)
ENDIF
PAUSE 1000
LOOP
CLOSE GPS
END

Last edited: 25 February, 2021