Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Gauge value to display not deleting prior value #10

Open
VR-Architect opened this issue Jan 2, 2024 · 5 comments
Open

Write Gauge value to display not deleting prior value #10

VR-Architect opened this issue Jan 2, 2024 · 5 comments

Comments

@VR-Architect
Copy link

Hello,
Excellent library. I am enjoying it.

I have a gauge on the display with a value 90 as it's default value. I send an Arduino command to set it to 180 and the dial moves to 180. However, it is still showing the old 90 value dial hand. So basically I have two dial hands; one at 90 and the other at 180. Is there some clear command I should put in prior to changing the value?

I tried both these ways:

NextionComponent gauge0(nextion, 0, 2);

void loop(){
   //gauge0.value(180);
    gauge0.attribute("val", 180);
} 

thanks for the help.

@InnuendoPi
Copy link

Did you update your comport instance?

NextionComPort nextion;
...
void loop(){
gauge0.attribute("val", 180);
nextion.update();
}

@VR-Architect
Copy link
Author

I tried the update but didn't work either. When debuging inside Nextion Editor the issue is the same. I found out that if the gauge is set for crop image and located ontop of a picture as a full background this happens. If I switch the gauge to "solid color" the gauge works correctly. So it is a refresh thing.

I found a refresh command "ref 0" where 0 is the id of the control to refresh. Page0 is ID 0. So by changing my guage values followed by sending a page refresh fixed the issue in the Nextion Editor.

How do I send a page refresh via this library?

Thanks again

@sstaub
Copy link
Owner

sstaub commented Jan 2, 2024

I think you must send the command "page x". See https://wiki.iteadstudio.com/Nextion_Instruction_Set

@VR-Architect
Copy link
Author

Thanks, but how do I send a generic command via the library?

@sstaub
Copy link
Owner

sstaub commented Jan 3, 2024

Have a look to the documentation. e.g. nextion.command("cir 50,50,20,WHITE");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants