fix!: incorrect work address auto increment mode on 6 digits display
This commit is contained in:
1 parent
9b769ece74
commit
ff3f404bb5
4 files changed
+19
-37
No files matched your search
@@ -74,30 +74,13 @@ void app_main(void)
|
||||
config.dio_gpio = GPIO_NUM_26;
|
||||
zh_tm1637_init(&config, &tm1637_handle);
|
||||
zh_tm1637_set_brightness(&tm1637_handle, 7); // Set brightness.
|
||||
uint8_t clear_symbols[4] = {0x00};
|
||||
zh_tm1637_print(&tm1637_handle, 0, clear_symbols, sizeof(clear_symbols)); // Clear LCD.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
for (;;)
|
||||
for (uint8_t i = 0; i < 6; ++i) // Clear LCD.
|
||||
{
|
||||
uint8_t symbol = 0x3F;
|
||||
zh_tm1637_print(&tm1637_handle, 0, &symbol, sizeof(symbol)); // 0 on 0 position.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 1, &symbol, sizeof(symbol)); // 0 on 1 position.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 0, clear_symbols, sizeof(clear_symbols)); // Clear LCD.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
uint8_t symbols[] = {0x40, 0x06, 0x5B, 0x4F};
|
||||
zh_tm1637_print(&tm1637_handle, 0, symbols, sizeof(symbols)); // -123 start from 0 position.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 0, clear_symbols, sizeof(clear_symbols)); // Clear LCD.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 1, symbols, sizeof(symbols)); // -123 start from 1 position.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 0, clear_symbols, sizeof(clear_symbols)); // Clear LCD.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
const zh_tm1637_stats_t *stats = zh_tm1637_get_stats();
|
||||
printf("Number of RMT driver error: %ld.\n", stats->rmt_driver_error);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
zh_tm1637_print(&tm1637_handle, i, 0x00);
|
||||
};
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 0, 0x4F); // 3 on C0H address.
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
zh_tm1637_print(&tm1637_handle, 4, 0x87); // 7. on C4H address.
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user