Product Overview

1/29/2018 ESP32 Thing Motion Shield Hookup Guide - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/esp32-thing-motion-shield-hookup-guide?_ga=2.240586115.1022152466.1517244327-204410570.1509632255 8/17
COPY CODE
The pins listed in Hardware Overview are also listed here as #defines you can use. Not all are necessary for every
application, but it’s nice to have them all in one place for reference.
#define AUX_LED_PIN 13
#define GPS_TX_PIN 16
#define GPS_RX_PIN 17
#define SD_SCK_PIN 18
#define SD_DO_PIN 19
#define SD_DI_PIN 23
#define SD_CS_PIN 33
#define SD_CD_PIN 38
#define IMU_SDA_PIN 21
#define IMU_SCL_PIN 22
Using the IMU
The IMU on the shield is the LSM9DS1, which is connected the the ESP32 Thing to the I2C port only. Any of the
examples from the LSM9DS1 library should be good to go, as long as you specify the port type to be I2C with default
addresses.
There are two examples in this section that will work without modification on the Motion Board.
The first example is a modification of the LSM9DS1_ESP32_Settings.ino example, with SPI related information
removed. This is a good place to start because it shows all of the API, and you can comment out what you don’t
need.
The second example is more heavily modified example. It outputs CSV data to the serial port (which can be rerouted
to a file if you’re into that). Here, a simple configuration is chosen but more work is done with the output data.
COPY CODE
/*****************************************************************
LSM9DS1_ESP32_Settings.ino
SFE_LSM9DS1 Library Settings Configuration Example
Original Creation: August 13, 2015 by Jim Lindblom
https://github.com/sparkfun/LSM9DS1_Breakout
This Arduino sketch demonstrates how to configure every
possible configuration value in the SparkFunLSM9DS1 library.
It demonstrates how to set the output data rates and scales
for each sensor, along with other settings like LPF cutoff
frequencies and low-power settings.
It also demonstrates how to turn various sensors in the
LSM9DS1 on or off.
Hardware setup: This library is intended to be used with a
COPY CODE
/*****************************************************************
LSM9DS1_CSV.ino
Collecting IMU data as CSV for graphing
O i i l C ti A t 13 2015 b Ji Li dbl