2 Commits

Author SHA1 Message Date
68ee6431fc fix: backlighting not on 2025-05-25 08:45:30 +03:00
eee073c742 doc: updated example 2025-05-25 08:41:38 +03:00
3 changed files with 7 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ void app_main(void)
#else
pcf8574_init_config.i2c_handle = i2c_bus_handle;
#endif
pcf8574_init_config.i2c_address = 0x38;
pcf8574_init_config.i2c_address = 0x27;
zh_pcf8574_init(&pcf8574_init_config, &lcd_1602a_handle);
zh_1602a_init(&lcd_1602a_handle);
for (;;)
@@ -107,6 +107,7 @@ void app_main(void)
zh_1602a_print_int(&lcd_1602a_handle, i);
zh_1602a_print_char(&lcd_1602a_handle, "%");
zh_1602a_print_progress_bar(&lcd_1602a_handle, 1, i);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
vTaskDelay(5000 / portTICK_PERIOD_MS);
zh_1602a_lcd_clear(&lcd_1602a_handle);

View File

@@ -1 +1 @@
1.0.1
1.0.2

View File

@@ -156,16 +156,16 @@ static void _zh_1602a_lcd_init(zh_pcf8574_handle_t *handle)
static void _zh_1602a_send_command(zh_pcf8574_handle_t *handle, uint8_t command)
{
zh_pcf8574_write(handle, (command & 0xF0));
zh_pcf8574_write(handle, (command & 0xF0) | 0x08);
LCD_1602A_PULSE;
zh_pcf8574_write(handle, command << 4);
zh_pcf8574_write(handle, (command << 4) | 0x08);
LCD_1602A_PULSE;
}
static void _zh_1602a_send_data(zh_pcf8574_handle_t *handle, uint8_t data)
{
zh_pcf8574_write(handle, (data & 0xF0) | 0x01);
zh_pcf8574_write(handle, (data & 0xF0) | 0x09);
LCD_1602A_PULSE;
zh_pcf8574_write(handle, (data << 4) | 0x01);
zh_pcf8574_write(handle, (data << 4) | 0x09);
LCD_1602A_PULSE;
}