Start a new topic

Values of bt.X objects are changing from 1 to 0 or 0 to 1 while using interface

Hello. Sorry for my maybe bad english.

I make a gui in nextion enchanced 7.0. It is connected to arduino mega2560. On nextion editor realized EEPROM and RTC.  

I found a next bug. While changing screens or values of buttons nextion lagging a little and some other values of buttons can change from 1 to 0 or from 0 to 1 for a few seconds. This values go to arduino and it makes changes in my arduino program that is not good. It can "ON" or "OFF" my "Lamp" when it is work from time periods. 

I made delays how offen arduino asks values from nextion it is solves my problem at 40% but that bug don't miss at 100%.  

Maybe you can find some bad desigions in my program and can help me to solve that problem.

Whant to add that while panel is in sleep mode or you don't change values on it everithing is fine. It starts while page initialization or change any value at gui.


follow your programm logic ... everything exactly happens as you code it ... nothing happens by itself ...


Do you also work when asleep? 

Or must you wake and get coffee before work?

 And perhaps sleep again when you get home?

"Do you also work when asleep? 

Or must you wake and get coffee before work?

 And perhaps sleep again when you get home?"

Panel have delay 2 min, if there is no any touches on a screen display goes to sleep mode, after touching on screen it's wake up. 

Timers works with a heating generators. One gas, second electrical, third wood.

and while using a panel one of the generators starts and stops for few seconds it's bad 

i thought that it is a bug at nextion code exactly with eeprom, not in my arduino project. Cause i am solving this problem for a long time and i have tried diferrent options in arduino project.

do i need to make some delays when data reading or writining in nextion's eeprom?

MCUs do only as exactly told to do.

Including sleep.

But MCU is in control.

Nextion EEPROM does not require any other "delays" other than told in Nextion Instruction Set.

Obviously EEPROM takes more time to access for reading and even more for writing

MCU is in control

 - MCU responsibility to listen Nextion Return Data

 - Nextion isn't being chatty for the sake of being chatty but so that MCU can be synchronized and work well together.

Nextion is an HMI device -  Human Machine Interface

  MCU provides choices for selection or options for entry

  Nextion issues request

  MCU considers if request is safe to do so at this time

  MCU executes if/when request is safe to do so

  MCU send status/progress back to user.

Nextion also only does as coded to do.

If logic on Nextion and MCU, then this forms parallel processing

 and as such, considerations for such behaviours need to addressed by code.

Delays?  if you refer to delay() this is a halt in place and do absolutely nothing.

If you are not referring to a do absolutely nothing then you must define your logic.

Thank you for your answer. 

I think that my lags happend cause there is to short time for waiting answer though UART channel from nextion to arduino. I will try to fix it, hope it wil help.

Login or Signup to post a comment