wip:
This commit is contained in:
@@ -7,7 +7,7 @@ static zh_pcf8574_handle_t _button_handle = {0};
|
|||||||
static zh_pcf8574_handle_t _led_1_handle = {0};
|
static zh_pcf8574_handle_t _led_1_handle = {0};
|
||||||
static zh_pcf8574_handle_t _led_2_handle = {0};
|
static zh_pcf8574_handle_t _led_2_handle = {0};
|
||||||
static zh_pcf8574_handle_t _relay_handle = {0};
|
static zh_pcf8574_handle_t _relay_handle = {0};
|
||||||
static zh_pcf8574_handle_t lcd_handle = {0};
|
static zh_pcf8574_handle_t _lcd_handle = {0};
|
||||||
|
|
||||||
static zh_encoder_handle_t _power_encoder_handle = {0};
|
static zh_encoder_handle_t _power_encoder_handle = {0};
|
||||||
static zh_encoder_handle_t _component_encoder_handle = {0};
|
static zh_encoder_handle_t _component_encoder_handle = {0};
|
||||||
@@ -125,8 +125,8 @@ static void _zh_pcf8574_init(void)
|
|||||||
config.i2c_address = RELAY_I2C_ADDRESS;
|
config.i2c_address = RELAY_I2C_ADDRESS;
|
||||||
zh_pcf8574_init(&config, &_relay_handle);
|
zh_pcf8574_init(&config, &_relay_handle);
|
||||||
config.i2c_address = LCD_I2C_ADDRESS;
|
config.i2c_address = LCD_I2C_ADDRESS;
|
||||||
zh_pcf8574_init(&config, &lcd_handle);
|
zh_pcf8574_init(&config, &_lcd_handle);
|
||||||
zh_160x_init(&lcd_handle, ZH_LCD_16X4);
|
zh_160x_init(&_lcd_handle, ZH_LCD_16X4);
|
||||||
config.p0_gpio_work_mode = true;
|
config.p0_gpio_work_mode = true;
|
||||||
config.p1_gpio_work_mode = true;
|
config.p1_gpio_work_mode = true;
|
||||||
config.p2_gpio_work_mode = true;
|
config.p2_gpio_work_mode = true;
|
||||||
@@ -299,9 +299,9 @@ static void _zh_encoder_event_handler(void *arg, esp_event_base_t event_base, in
|
|||||||
switch (event->encoder_number)
|
switch (event->encoder_number)
|
||||||
{
|
{
|
||||||
case POWER_ENCODER:
|
case POWER_ENCODER:
|
||||||
zh_160x_set_cursor(&lcd_handle, 0, 11);
|
zh_160x_set_cursor(&_lcd_handle, 0, 11);
|
||||||
zh_160x_print_int(&lcd_handle, (uint8_t)event->encoder_position);
|
zh_160x_print_int(&_lcd_handle, (uint8_t)event->encoder_position);
|
||||||
zh_160x_print_char(&lcd_handle, "% ");
|
zh_160x_print_char(&_lcd_handle, "% ");
|
||||||
zh_ac_dimmer_set(event->encoder_position);
|
zh_ac_dimmer_set(event->encoder_position);
|
||||||
break;
|
break;
|
||||||
case COMPONENT_ENCODER:
|
case COMPONENT_ENCODER:
|
||||||
|
|||||||
Reference in New Issue
Block a user