Example8 shows how to use the SPI Breakout Plated-Through Holes (PTHs) on the left edge of the board. The
example assumes you have a SparkFun Micro OLED Display connected, but you can adapt the code to talk to
whichever SPI board you have available. The SPI port is called SPI on the Asset Tracker.
Example 9: VIN
Example9 demonstrates how to read the VIN bus voltage using the resistor divider on the Asset Tracker. The
function
in AssetTrackerPins.ino automatically converts the Analog To Digital Converter result into
readVIN()
voltage correctly for the different Processor Boards.
Example 10: IMU Wake-On-Motion
Example10 demonstrates how the ICM-20948 IMU can be configured to detect motion or an impact. This example
could be a key part of your final asset-tracking code.
Example 11: GNSS GPRMC
Example11 demonstrates how to read the Asset Tracker's location using the u-blox M8 GNSS receiver built into
the SARA-R5. The GNSS generates an NMEA GPRMC data stream and our SARA-R5 library does the heavy
lifting for you, extracting the latitude and longitude etc. as numbers.
Example 12: Identification
Example12 is the first example which communicates with the LTE part of SARA-R5. The example reads data from
the SARA including its ID, firmware version, serial number, IMEI and subscriber number. The subscriber number -
if present - comes from the SIM. This example demonstrates that the SIM is inserted correctly.
Example 13: Network Information
Example13 is the first example which checks that the SARA is receiving an LTE signal. The code prints the
received signal strength, registration status and data "context ID". The SARA reads your operator details from the
SIM and uses those when registering on the network.
It is important that you run examples 13, 14 and 17 in order as each plays a role in making sure the SARA's data
connection is configured correctly.
Example 14: Register Operator
Example14 shows if you are already connected to a network and gives you the opportunity to register on a
different network (if one is available and if your SIM supports this). You can use this example to list all of the LTE
operators the SARA can detect, but you will only be able to connect to networks supported by your SIM.
Example 15: Receive SMS
For many applications, good old Short Message Service text messaging is a good solution. Example15
demonstrates how to read and print any existing text messages in the SARA's memory. The code will then wait for
a new message to arrive and will print it when it does.
Incoming messages are automatically marked as read once they have been printed by the code. You can force the
code to print all the messages in memory by commenting the line which says:
if (unread == "REC UNREAD") // Only print new (previously-unread) messages.
Need help?
Do you have a question about the DEV-17272 and is the answer not in the manual?
Questions and answers