SparkFun GPS Breakout - XA1110 (Qwiic) Hookup Guide

Pages
Contributors: Englandsaurus
Favorited Favorite 5

Library Overview

First, you'll need to download and install the Sparkfun I2C GPS library, this can be done using the button below or by using the Arduino Library Manager.

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

Before we get started developing a sketch, let's look at the available functions of the library.

  • boolean begin(TwoWire &wireport = Wire, uint32_t i2cSpeed = I2C_SPEED_STANDARD); --- begin() is used to start the GPS, it runs sort of like this:
    • Starts running the I2C port at the given port and clock speed
    • Pings the module and checks for a response
    • Returns TRUE if the response is received, FALSE if not.
  • void check(); --- Checks the module for new data.
  • uint8_t available(); --- Returns the available number of bytes. Will call check() if zero is available.
  • uint8_t read(); --- Returns the next available byte.
  • void enableDebugging(Stream &debugPort = Serial); --- Outputs various messages to assist in debugging.
  • void disableDebugging(); --- Pretty self explanatory, turns off debugging.
  • boolean sendMTKpacket(String command); --- Can be used to send a command or configuration to the GPS module.
    • The input buffer on the MTK is 255 bytes, so strings must be shorter than 255 bytes.
    • After ending a transmission, give the module 10 ms to process the message.
  • String createMTKpacket(uint16_t packetType, String dataField); --- Creates a config sentence (String) from a packetType and any settings. See 'MTK NMEA Packet' datasheet for more info.
  • String calcCRCforMTK(String sentence); --- XORs bytes to create MTK packet.

Note: Due to a new QZSS satellite recently launched by the Japanese, users in the Asia-Pacific region (Longitude 70 to -160 degrees East) can experience huge drifts in location over the course of 2 hours. In order to remedy this, two options are available. The first is to simply reset the module every 2 hours. The second option is to disable the QZSS feature entirely. To do this, simply use the following command in your setup loop. sendMTKpacket($PMTK352,1*2B);