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 11/17
Using the I2C and SPI Buses
To demonstrate the attachment of additional I2C and SPI devices, a BME280 is used. This could be any device, but
the BME280 has both ports and is pretty easy to work with. There is one catch though, the SPI bus is shared with the
microSD card and it will limit in the microSD card’s data rate to the lowest common speed.
The two examples show are actually the same program, but with two lines which are configured for either I2C or SPI
mode.
I2C
Hookup the I2C pins between the BME280 and the ESP32 Thing as shown below.
COPY CODE
/******************************************************************************
FileSerialExample.ino
Example Serial-like file writer
Marshall Taylor @ SparkFun Electronics
original creation date: Nov 6, 2017
https://github.com/sparkfun/ESP32_Motion_Shield
This example demonstrates usage of the FileSerial library.
The FileSerial libary implements the ESP32 SD_Test functions as a class that acts like a
HardwareSerial device. It has been modeled from the ESP32 Arduino core's
HardwareSerial class, but takes no input streams from the user.
There are a couple extra functions that aren't normally found in a serial device
int startLog( const char * inputPath, const char * inputStub );
int stopLog( void );