Adding a start screen / remembering settings

Dear Community,

I have just bought my first batch of 4 Basic 2,4" displays that i want to use on a small weight scale project together with an arduino nano and multiple hx711 weight scales. It is my first time to nextion, i am somewhat firm in Arduino though.

Now i am running into a basic problem and also a question. So here goes:

Basic Problem: I want upon powerup to show a startscreen while the arduino is booting and tara-ing the scales. After 4 or 5 seconds i want to switch automatically to the menu page.

//The following code is only run once when power on, and is generally used for global variable definition and power on initialization data
int sys0=0,sys1=0,sys2=0 //At present, the definition of global variable only supports 4-byte signed integer (int), and other types of global quantity declaration are not supported. If you want to use string type, you can use variable control in the page to implement
page 0 //Power on start page 0
delay(4000)
page 1

This is how i modified the program.h but the delay(4000) causes a compilation error. How do i initiate an automatic change from page 0 to page 1 after xyz time?

Next question concerns the displays capabilities to remember last settings. For instance there will be a settings page where the weight sensors are selected. 1kg, 5kg and 20kg for example, via a pulldown menu. Now if i select 5kg, can i save this as default for next powerup? Or do i need to remember the setting in the Arduino EEPROM and send/retrieve from there?

Thanks!

Cheers

Add a timer object to the page and either enable it by default or set the timer.en=1 in your init code.

For an example check this Youtube video:

Thanks that solved it. GGracias ;). Now have a different problem but i will start a suitable thread.
Thanks again

1 Like