esp-idf/examples/cxx/experimental/esp_timer_cxx
Djordje Nedic facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
..
main Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
CMakeLists.txt tools: Increase the minimal supported CMake version to 3.16 2022-06-01 06:35:02 +00:00
README.md esp_timer: added C++ wrapper for esp_timer 2020-12-14 11:17:56 +08:00
sdkconfig.defaults esp_timer: added C++ wrapper for esp_timer 2020-12-14 11:17:56 +08:00

Example: ESPTimer C++ class

(See the README.md file in the upper level 'examples' directory for more information about examples.)

This example demonstrates usage of the ESPTimer c++ class 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++ APIs.

How to use example

Hardware Required

Any ESP32 family development board.

Configure the project

idf.py menuconfig

Build and Flash

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.

Example Output

Setting up timer to trigger in 500ms
timeout
Setting up timer to periodically every 200ms
periodic timeout
periodic timeout
periodic timeout
periodic timeout
periodic timeout