0

I have a Nextion 7 inch enhance type display. I have enabled sleep using thsp = 120 and thup = 1 line of code. Now display become sleep mode after 2min, if there is no any touch event.

But, this sleeping is completely turn off the display.

I have several pages and I want to reset to a specific page, if there is no any touch event in any page instead of sleep function.

Greatly appreciate if someone can give a solution for this.

asked Feb 7, 2019 at 10:29
0

2 Answers 2

2

I solved the problem using a Nextion timer. (tm0)

I got a timer and change tim value. ( unfortunately Nexion allow to maximum to 65535mS). vscope should be globle, otherwise you cant use timer in every page.

I reset the timer in page touch event. In timer event I put this code.

if(tm0.tim==60000) //reset time in mS
{
 page 0 //specific page to load
}
answered Feb 7, 2019 at 12:10
2

The Nextion screen has a command for this. It is called wup and defines the id of page that the screen should go to on wake from sleep. The default is set to 255, which means that the display wakes up on the page it was on before the sleep event.

16 wup Wake Up
 Page wup=2, n0.val=wup 
Sets which page Nextion loads when exiting sleep mode
 min is 0, max is # of last page in HMI, or default 255
 When wup=255 (not set to any existing page)
– Nextion wakes up to current page, refreshing components only
 wup can be set even when Nextion is in sleep mode 
answered Jul 16, 2019 at 6:59
1
  • Thanks for your answer. But, I want to sleep to a specific page. Not wake up. wup sets wake up page. Not sleep page. Commented Oct 1, 2019 at 8:32

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.