|
|
5 éve | |
|---|---|---|
| .. | ||
| main | 5 éve | |
| CMakeLists.txt | 5 éve | |
| Makefile | 5 éve | |
| README.md | 5 éve | |
| sdkconfig.defaults | 5 éve | |
(See the README.md file in the upper level 'examples' directory for more information about examples.)
This example demonstrates usage of C++ exceptions in ESP-IDF.
In this example, the sdkconfig.defaults file sets the CONFIG_COMPILER_CXX_EXCEPTIONS option.
This enables both compile time support (-fexceptions compiler flag) and run-time support for C++ exception handling.
This is necessary for the C++ I2C API.
An MCP9808 sensor and any commonly available ESP32 development board. Pullups aren't necessary as the default pullups are enabled in the I2CMaster class.
idf.py menuconfig
idf.py -p PORT flash monitor
(Replace PORT with the name of the serial port.)
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
If the sensor is read correctly:
Current temperature: 24.875
If something went wrong:
I2C Exception with error: ESP_FAIL (-1)
Coulnd't read sensor!