Expert to tidy Arduino Nextion code


I have completed a sketch to control a putting platform using Arduino but interfaced with a Nextion touch screen, I am looking for someone to review my code and hopefully put it into the most efficient format. As the sketch is large I will attach it below.

Many Thanks

PuttMasterFinalcopy.28.5.19.ino (33.6 KB)

What's the budget?


As the code works ok I was thinking up to £200 to make it more efficient.


More efficient in what respect? Speed? Size?

Im just learning at the moment, I know the nextion code is as it should be but was wondering if there is a way to reduce the rest and make it more effiecent?

There is not much rest if you ignore the Nextion code :slight_smile: Again, what would you like to optimize it for?

LOTS of repetition in the code. Many variables with numbers - that's calling for arrays and for loops. Code can definitely made MUCH shorter.

Budget sounds quite reasonable but without the actual hardware I'm not going to burn my hands on this. Optimising is bound to introduce new bugs - without the actual hardware it's hard to figure out what it's supposed to do and whether behaviour is not changed by these optimisations.

Why do you even want to mess around with the code? I may assume it works now?