Question
Changing Brightness
Hi I am having some trouble adjusting the brightness for the STM32F7.
I used this in main.c, and externed it
I tried using this in model.cpp and in main.c, neither seems to adjust the brightness of the display.
void setDutyCycle(float duty_cycle) {
if (duty_cycle > 100) duty_cycle = 100;
if (duty_cycle < 0 ) duty_cycle = 0;
float pw_resolution = (((float)99 + 1.0f) / 100.0f);
uint16_t pw_desired = pw_resolution * duty_cycle;
__HAL_TIM_SET_COMPARE( &htim2, TIM_CHANNEL_3, pw_desired );
}
Code formatting applied - please see How to insert source code for future reference
