myfreax / esp32-timer

ESP32 timer component, It has javascript-like syntax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESP32 Timer Component

General Software Timer

Usage

git submodule add git@github.com:myfreax/esp32-timer.git components/timer
#include "timer.h"

esp_timer_handle_t handle;

void callback(void* arg) {
  esp_timer_handle_t* timer = arg;
  ESP_ERROR_CHECK(esp_timer_delete(*timer));
}

ESP_ERROR_CHECK(
    set_timeout("once", callback, &handle, &handle, time_us));

ESP_ERROR_CHECK(
set_interval("repeat_times", callback, &handle, &handle, time_us));

Example

The ESP32 Example Project demonstrates how to use IDF framework build application of reusable component

About

ESP32 timer component, It has javascript-like syntax


Languages

Language:C 45.6%Language:Dockerfile 30.9%Language:CMake 23.5%