wip:
This commit is contained in:
23
README.md
23
README.md
@@ -1,3 +1,24 @@
|
||||
# esp_component_template
|
||||
|
||||
esp_component_template
|
||||
esp_component_template
|
||||
|
||||
#include "zh_tachometer.h"
|
||||
|
||||
zh_tachometer_handle_t tachometer_handle = {0};
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
esp_log_level_set("zh_tachometer", ESP_LOG_ERROR);
|
||||
zh_tachometer_init_config_t config = ZH_TACHOMETER_INIT_CONFIG_DEFAULT();
|
||||
config.a_gpio_number = GPIO_NUM_26;
|
||||
config.b_gpio_number = GPIO_NUM_27;
|
||||
config.encoder_pulses = 3600;
|
||||
zh_tachometer_init(&config, &tachometer_handle);
|
||||
for (;;)
|
||||
{
|
||||
int16_t value = 0;
|
||||
zh_tachometer_get(&tachometer_handle, &value);
|
||||
printf("Tachometer value is %d rpm.\n", value);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user