Solar balkony power plant, which includes control logic for switching between micro inverter and battery depending on the state of charge. The repository containing any drawings and manuals.
turn of background light of ILI9341 for increasing lifetime and saving energy
:pencil2: Describe the solution you'd like
turn off display after x-seconds
turn it on if touch input was detected
auto StandbyHandler(uint32_t &uiElapsed, uint32_t uiTarget, bool xTouched) -> void
{
static bool xStandby = false;
if (!xTouched
&& millis() - uiElapsed >= uiTarget * 1000
&& !xStandby)
{
// fade out HMI if no touch input
xStandby = true;
for (auto i = uiTftBrightness; i > 0; i--)
{
analogWrite(TFT_LED, i);
delay(10);
}
}
// Turn on, if touch was pressed
else if (xTouched && xStandby)
{
xStandby = false;
for (auto i = 0; i < uiTftBrightness; i++)
{
analogWrite(TFT_LED, i);
delay(10);
}
}
if(xTouched)
uiElapsed = millis(); // reset timer
}
I call the function in my hmi touch Loop. One time before touch was detected and one time after touch was detected. With this two calls i know with the passing of trueor falsewhether touch was detected and i can start timers for turning off the background light.
:rocket: Please describe your feature request
:pencil2: Describe the solution you'd like
I call the function in my hmi touch Loop. One time before touch was detected and one time after touch was detected. With this two calls i know with the passing of
true
orfalse
whether touch was detected and i can start timers for turning off the background light.:pushpin: Describe alternatives you've considered
Additional context
:white_check_mark: Tasks