Compare commits
1 Commits
77ba8e58b9
...
v2.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b4224641db |
11
README.md
11
README.md
@@ -1,17 +1,13 @@
|
|||||||
# ESP32 ESP-IDF component for AC dimmer
|
# ESP32 ESP-IDF component for AC dimmer 115V/400Hz
|
||||||
|
|
||||||
## Tested on
|
## Tested on
|
||||||
|
|
||||||
1. [ESP32 ESP-IDF v5.5.1](https://docs.espressif.com/projects/esp-idf/en/v5.5.1/esp32/index.html)
|
1. [ESP32 ESP-IDF v5.5.1](https://docs.espressif.com/projects/esp-idf/en/v5.5.1/esp32/index.html)
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
1. Supports frequency up to 400 Hz.
|
|
||||||
2. Automatic frequency detection.
|
|
||||||
|
|
||||||
## Attention
|
## Attention
|
||||||
|
|
||||||
For correct operation, please enable the following settings in the menuconfig:
|
1. Supports frequency 400Hz only.
|
||||||
|
2. For correct operation, please enable the following settings in the menuconfig:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
GPIO_CTRL_FUNC_IN_IRAM
|
GPIO_CTRL_FUNC_IN_IRAM
|
||||||
@@ -47,7 +43,6 @@ void app_main(void)
|
|||||||
zh_ac_dimmer_init_config_t config = ZH_AC_DIMMER_INIT_CONFIG_DEFAULT();
|
zh_ac_dimmer_init_config_t config = ZH_AC_DIMMER_INIT_CONFIG_DEFAULT();
|
||||||
config.zero_cross_gpio = GPIO_NUM_16;
|
config.zero_cross_gpio = GPIO_NUM_16;
|
||||||
config.triac_gpio = GPIO_NUM_17;
|
config.triac_gpio = GPIO_NUM_17;
|
||||||
config.ac_frequency = 50;
|
|
||||||
zh_ac_dimmer_init(&config);
|
zh_ac_dimmer_init(&config);
|
||||||
zh_ac_dimmer_start();
|
zh_ac_dimmer_start();
|
||||||
uint8_t value = 0;
|
uint8_t value = 0;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.3.0
|
2.0.0
|
||||||
@@ -113,7 +113,7 @@ esp_err_t zh_ac_dimmer_get(uint8_t *value)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static esp_err_t _zh_ac_dimmer_validate_config(const zh_ac_dimmer_init_config_t *config) //-V2008
|
static esp_err_t _zh_ac_dimmer_validate_config(const zh_ac_dimmer_init_config_t *config)
|
||||||
{
|
{
|
||||||
ZH_ERROR_CHECK(config != NULL, ESP_ERR_INVALID_ARG, NULL, "Initial config is NULL.");
|
ZH_ERROR_CHECK(config != NULL, ESP_ERR_INVALID_ARG, NULL, "Initial config is NULL.");
|
||||||
ZH_ERROR_CHECK((config->zero_cross_gpio >= GPIO_NUM_0 && config->zero_cross_gpio < GPIO_NUM_MAX), ESP_ERR_INVALID_ARG, NULL, "Zero cross GPIO invalid.");
|
ZH_ERROR_CHECK((config->zero_cross_gpio >= GPIO_NUM_0 && config->zero_cross_gpio < GPIO_NUM_MAX), ESP_ERR_INVALID_ARG, NULL, "Zero cross GPIO invalid.");
|
||||||
|
|||||||
Reference in New Issue
Block a user