Seithan / EasyNextionLibrary

A simple library for Nextion display that uses only four functions. You can easily benefit from Nextion's wide range of features and advantages in just a few easy steps. The library uses a custom protocol that can prove to be a powerful tool for advanced users as it can be easily modified to meet one’s needs.
MIT License
116 stars 29 forks source link

(solved) Collect sleep information #25

Closed D-Salmon closed 3 years ago

D-Salmon commented 3 years ago

Hi, I've discovered your awesome library and I have a request. To stop sending commands for refreshing values to Nextion, I'd like to be informed when Nextion is in sleep mode. I've seen that the display sends 0x86 but I haven't found how to collect it wih your library

plckr commented 3 years ago

I'm interested in this. Subscribing...

Seithan commented 3 years ago

Hello,

How are you planning to make the Nextion go to sleep mode? With what way?

D-Salmon commented 3 years ago

Hi Seithan I only configure in Nextion thsp=15 thup=1 When the display enters in sleep mode after15 seconds, it sends 86 FF FF FF It sends 87 FF FF FF when it wakes up If I could receive these informations, I would stop communication beetween Arduino and Nextion for a while

Seithan commented 3 years ago

Hello I made some modifications. I will attach the files. You have to replace those two files in the library's folder and then give it a try. A new public variable is there boolean sleep that is true when a 86 FF FF FF is received and false when 87 FF FF FF

    if(myNex.sleep == true){
    myNex.writeStr("t1.txt", "sleep = true");
  }else if(myNex.sleep == false){
    myNex.writeStr("t1.txt", "sleep = false");    
  }

EasyNextionLibrary.zip

Seithan commented 3 years ago

Hello,

I made some changes in these files. I removed some debug commands that I forgot.

EasyNextionLibrary.zip

D-Salmon commented 3 years ago

Hello Seithan Fantastic, exactly what I needed. Thank you so much for your job

Seithan commented 3 years ago

Have you tried them?

Please give me a feedback if the files are working, so I can change them in a future release.

If you do not need anything else from this issue, close it and give a star to the library on the top right corner :)

D-Salmon commented 3 years ago

Hi Seithan, Of course I've tried and it works like a charm.

plckr commented 3 years ago

This feature was already released?

Seithan commented 3 years ago

Hello @ricreis394, I have not released this feature yet, as I want to see some other modifications.

Do you need the release now or can you do it with the two attached files?