2023-11-02 04:44 AM
my original lcd settings
void MX_LCD_Init(void)
{
/* USER CODE BEGIN LCD_Init 0 */
/* USER CODE END LCD_Init 0 */
/* USER CODE BEGIN LCD_Init 1 */
/* USER CODE END LCD_Init 1 */
hlcd.Instance = LCD;
hlcd.Init.Prescaler = LCD_PRESCALER_8;
hlcd.Init.Divider = LCD_DIVIDER_16;
hlcd.Init.Duty = LCD_DUTY_1_4;
hlcd.Init.Bias = LCD_BIAS_1_3;
hlcd.Init.VoltageSource = LCD_VOLTAGESOURCE_INTERNAL;
hlcd.Init.Contrast = LCD_CONTRASTLEVEL_3;
hlcd.Init.DeadTime = LCD_DEADTIME_0;
hlcd.Init.PulseOnDuration = LCD_PULSEONDURATION_4;
hlcd.Init.MuxSegment = LCD_MUXSEGMENT_DISABLE;
hlcd.Init.BlinkMode = LCD_BLINKMODE_OFF;
hlcd.Init.BlinkFrequency = LCD_BLINKFREQUENCY_DIV128;
hlcd.Init.HighDrive = LCD_HIGHDRIVE_DISABLE;
if (HAL_LCD_Init(&hlcd) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LCD_Init 2 */
/* USER CODE END LCD_Init 2 */
}
My lcd settings changed
void MX_LCD_Init(void)
{
/* USER CODE BEGIN LCD_Init 0 */
/* USER CODE END LCD_Init 0 */
/* USER CODE BEGIN LCD_Init 1 */
/* USER CODE END LCD_Init 1 */
hlcd.Instance = LCD;
hlcd.Init.Prescaler = LCD_PRESCALER_1;
hlcd.Init.Divider = LCD_DIVIDER_16;
hlcd.Init.Duty = LCD_DUTY_1_4;
hlcd.Init.Bias = LCD_BIAS_1_3;
hlcd.Init.VoltageSource = LCD_VOLTAGESOURCE_INTERNAL;
hlcd.Init.Contrast = LCD_CONTRASTLEVEL_3;
hlcd.Init.DeadTime = LCD_DEADTIME_0;
hlcd.Init.PulseOnDuration = LCD_PULSEONDURATION_4;
hlcd.Init.MuxSegment = LCD_MUXSEGMENT_DISABLE;
hlcd.Init.BlinkMode = LCD_BLINKMODE_OFF;
hlcd.Init.BlinkFrequency = LCD_BLINKFREQUENCY_DIV128;
hlcd.Init.HighDrive = LCD_HIGHDRIVE_DISABLE;
if (HAL_LCD_Init(&hlcd) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LCD_Init 2 */
/* USER CODE END LCD_Init 2 */
}
hlcd.Init.Prescaler = LCD_PRESCALER_1;
By making this change, current consumption has decreased significantly.
However, the text on the LCD became blurred.
hlcd.Init.Prescaler = LCD_PRESCALER_1;
I would like to keep this and change the setting to make the text darker.
What settings should I change?