Datasheet
Or once a fix has been established (make sure the GPS module has a good view of the sky!) it will print details about
the current location and other GPS data:
Let's look at the code in a bit more detail to understand how it works. First the example needs to import a few
modules like the built-in busio and board modules that access serial ports and other hardware:
Next the GPS module is imported:
Now a serial UART is created and connected to the serial port pins the GPS module will use, this is the low level
transport layer to communicate with the GPS module:
Once a UART object is available with a connected GPS module you can create an instance of the GPS parsing class.
You need to pass this class the UART instance and it will internally read new data from the GPS module connected to
it:
Before reading GPS data the example configures the module by sending some custom NMEA GPS commands that
adjust the amount and rate of data. Read the comments to see some options for adjust the rate and amount of data,
but typically you want the defaults of core location info at a rate of once a second:
import board
import busio
import time
import adafruit_gps
# Define RX and TX pins for the board's serial port connected to the GPS.
# These are the defaults you should use for the GPS FeatherWing.
# For other boards set RX = GPS module TX, and TX = GPS module RX pins.
RX = board.RX
TX = board.TX
# Create a serial connection for the GPS connection using default speed and
# a slightly higher timeout (GPS modules typically update once a second).
uart = busio.UART(TX, RX, baudrate=9600, timeout=3000)
gps = adafruit_gps.GPS(uart)
© Adafruit Industries https://learn.adafruit.com/adafruit-ultimate-gps Page 21 of 40










