IoT RedBoard ESP32 Development Board Hookup Guide
Example 4: I2C
Our Qwiic Ecosystem is a fantastic way to add plug and play functionality to your board. For this example, we're going to use the SparkFun High Precision Temperature Sensor - TMP117 (Qwiic) to do some quick (Qwiic) temperature readings.
The hookup is a breeze - simply plug one end of a Qwiic cable into the TMP117 and the other end into your IoT RedBoard ESP32!
To find this example, you'll first need to install the Qwiic Library for whatever Qwiic Sensor you plan to use. For this example, go to Sketch > Include Library > Manage Libraries like so:
Search for SparkFun TMP117 in the window that comes up and install the library:
Great! Now that we have our library installed, we can run our example! Go to File > Examples > SparkFun High Precision Temperature Sensor TMP117 > Example1_BasicReadings.
Select the correct board and port, as always, and hit that upload button!
This particular example will check to see if the TMP117 measured and averaged the temperature readings. If there is data ready, the TMP117 will notify us from the configuration register. When ready, we'll read the temperature registers and output it out to the Arduino serial monitor.
Open the serial monitor at 115200 baud to start reading the temperature readings. You should see something like the output below.
Try heating the sensor with your finger or lightly breathe some air across the sensor to watch the temperature values change! The third reading from the output shows the temperature rising after placing my finger on the temperature sensor. Remember, the sensor is taking a few readings and averaging them together before we are able see the output. Make sure to be patient with the output.