%% Read Information from GPS Receiver
% Read information from the GPS receiver connected to the host computer on a specific serial port.
%% Required Hardware
% To run this example, you need:
% UBlox Neo-6M GPS module
% GPS antenna
% USB to UART module
% USB cable
% Connecting wires
%% Hardware Connection
%
% Connect the pins on the UBlox Neo-6M GPS module to the pins on your USB to UART module. The connections are:
% VCC - +5V
% RX - TXO
% TX - RXI
% GND - GND
% Connect the GPS antenna to the GPS module. Connect the USB to UART module to the host computer with a USB cable. GPS Fix can be easily acquired in locations that have a clear view of the sky. Wait for the GPS module to acquire satelite signals (Fix).This can be verified by checking the Fix LED (D1) of your GPS module.
%
%% Create GPS Object
% Create a gpsdev object for the GPS receiver connected to a specific port.

gps = gpsdev('COM4')

%% Read the GPS Module Information
% Read the GPS module information and return them as a structure.

gpsInfo = info(gps)

%% Clean Up
% When the connection is no longer needed, clear the associated object.

delete(gps);
clear gps;

% Copyright 2020 The MathWorks, Inc.