This commit is contained in:
2025-06-14 15:03:00 +03:00
parent 15cdd50132
commit 219aa4b9d4
3 changed files with 24 additions and 2 deletions

View File

@@ -80,6 +80,15 @@ esp_err_t zh_encoder_set(zh_encoder_handle_t *handle, double position)
return ESP_OK;
}
esp_err_t zh_encoder_get(const zh_encoder_handle_t *handle, double *position)
{
ZH_ENCODER_LOGI("Encoder get position started.");
ZH_ENCODER_CHECK(handle->is_initialized == true, ESP_FAIL, "Encoder get position failed. Encoder not initialized.");
*position = handle->encoder_position;
ZH_ENCODER_LOGI("Encoder get position completed successfully.");
return ESP_OK;
}
esp_err_t zh_encoder_reset(zh_encoder_handle_t *handle)
{
ZH_ENCODER_LOGI("Encoder reset started.");