Hey everyone! Trying to solve a problem here -
I have a project with about 80 global variables over 6 pages that update constantly and simultaneously, and do so just fine.
In trying to free up ram, I am trying a couple approaches at freeing up memory:
- In progmem.s: defining global ints. ex., int var1, var2, var3, var4, etc. Then using those variables as master variables that I update right before a page load
- Using the variable function that puts them on the page on the bottom bar, writing to those in the background while not on the page, and restoring those values to the values on the page when the page is loaded (then just modifying the page values directly).
I can get both methods to work, but for some reason that I do not know what, writing to those global variables will slow things down to a chug and parts of my program will just cease to function because of some sort of delays happening. From what I can see, and I could be wrong, but it looks like writing to those defined global variables for some reason introduces some lag into the nextion. I’m using a 4.3 inch basic display.
Any insights into what I may be doing wrong? Just to reiterate, the display works awesome using the objects on the screen defined as global variables with very little to no lag and snappy integration with my arduino program. It just seems that once I start serving those defined global vars data, things start to chug.