Unofficial Nextion/TJC User Forum

Is it even possible to simplify my code? To avoid crashes?


I wrote a weather forecast application based on an ESP32 and NX8084K050_011.

In total 1172 images for 61 Icons:
46 animated weather icons
15 static weather icons

Serial commands are kept minimal by using variables:
First row: “vdsc0” … “vdsc6” for 7 images
Second row: “vhsc0” … “vhsc7” for 8 images
Values: -30 to +30 (negative: night, positive: day, zero: blank)
Only on changing page or changing icon will send new value (50-500/day)

Two timer cycle in 75ms:
“tmdsc” for first row, responsible for 7 icons
“tmhsc” for second row, responsible for 8 icons

Timer “tmdsc” has 2873 lines of code
Timer “tmhsc” has 3278 lines of code

On each timer event cycle as folowed:
Timer “tmdsc”: tmdsc.txt
Timer “tmhsc”: tmhsc.txt

I have tried add more(15 in total) timer but has no effect. Program Code has still the same line amount or more.

Is it even possible to simplify my code? Less lines? Any suggestions?

I’m thinking of switching to a raspberry pi without a nextion display…

Img1: nex1.png
Img2: nex2.png

Its very difficult to work with parts of a program , is it possible to get a copy of the hmi file to run in the simulator.

Obviously, the “official” Nextion staff is reading here and Patrick felt challenged…

Thanks for sharing the post from the blog. I guess I wouldn’t have seen it without.
I’m not sure how to assume this now… Do I feel embarrassed or proud that this is now on a blog?
Well I think this is a perfect example for creating “arrays”. I would definitely never have thought of it and I would like to see this as a tutorial to create arrays.

Thanks to everyone who took the time to take a closer look!

Almost forgot to share a picture…

1 Like

This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).