Send scale data to a Nextion display

Hi,

I have used the above code along with the sparkfun qwiic scale code to display a weight on the nextion screen.

I have a question about the

mySerial.print("t6.txt=\""); // Changing the value of box n1
  mySerial.print(avgWeight, 0);
  mySerial.print("\"");
  mySerial.write(0xff);  // We always have to send this three lines after each command sent to the nextion display.
  mySerial.write(0xff);
  mySerial.write(0xff);

how can i change this to display on page 2 for example?

Happy to read and figure out myself if some one could point me in the right direction that would be amazing.

Thanks
andy

TOPIC SPLIT
DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

To display on page 2 you have to be on page 2....

Nextion instruction set

Scroll down to 3 – Operational Commands and look for page (it's the first one).

PerryBebbington:
To display on page 2 you have to be on page 2....

Nextion instruction set

Scroll down to 3 – Operational Commands and look for page (it's the first one).

Hi Perry

I'll have a look at Link you posted thanks

Well I'm not sure what happened but I left it powered off and came back to it later and it worked as is???

I will double check tomorrow and do a bit more playing.

I also have another question.
If I want to set a target weight via the screen then can the screen do the processing for example.

User inputs 700g
Presses start.
Nextion looks at the value sent via Arduino as previously discussed above.
Then an if statement says
If target = <700
Then turn stepper at speed X.

And then if that's possible then different speeds depending on how much weight is in there so it would load the bulk at speed X
And the last 50g at speed y.

Hope that makes some sort of sense
Andy

Hi Andy,

While you can probably do the processing on the display that would not be my approach. Nextion displays come with a very limited programming language I call C--.

Please can you read the tutorial using Nextion displays with Arduino and try the examples? They cover much of what you want to know.