I'm working on the attached HMI file and in the debugger everything is looking fine.
But when I write the code onto the nextion display I got an unwanted behaviour.
The texts t0-t3 and crops q0-q3 are flashing everytime I change between the buttons CC and CV.
Does anybody know the reason for this behaviour and how to "fix" it?
Thank you very much in advance!
Sorry, I forgot the HMI file.
I have a basic 3.5" display.
This behaviour is included in every button event
You must program purposefully
- shortcut to just cut copy paste, and dump all is not in correct manner
What causes your flicker is the code
- you told it to do such
If programming purposefully
- only tell what you need and
- do not include what you don't
In this purposeful programming manner
- it would not flicker
Sorry but I don't understand, can you please be more specific?
In next versions of the programm it will be possible that either CC, CV, CR or CP is active.
If I want to change to the corresponding view, I have to "disable" and "enable" the cropping of the different texts and crops.
I can delete the ref command, but that doesn't help.
When you push a button, no need to deal with all every time.
Setting an attribute will redraw the component
Setting vis will redraw the component
Calling Ref will redraw the component
Any and every button press has all being redrawn
- even when it was already such option and not needed
Even as screen loads, you have full size picture
to be drawn on top of you main page of .bco WHITE
In all the redrawing is where your eye catch flicker
- it is barely noticing redraw changes
- not enough that you exactly recognized it is redraw effect
- but enough for you to see something is not right
- so you call it flicker.
But reducing what is called and redrawing
less time under I think ~75ms, it becomes to fast for the eye
and so you don't see it "flicker", to quick to notice.
Start with removing p0 and set picture 0 as background
- in main page, set .sta to image set .pic to 0
- try to comment out a few lines with // preceding the line
But although neat that your list allows you to see all values
it is in executing the unnecessary that takes too long
and this is what causes your flicker
comment out, still see expected value
End cap cropping does not need to be there
- textbox can exceed and cover entire crop frame
- you right aligned so that number wasn't on edge
but adding a trailing space to .txt will also do same.
Mostly don't make assignments to what hasn't changed
if not needed, it takes up the time and you have flicker
Wow thank you!
The hint "Start with removing p0 and set picture 0 as background" was the solution!
I saw the method with using a picture p0 as background in a youtube video and didn't know that it was possible without that.
I will also take into account your other hints.