It never crossed my mind you might have a power problem. Some photos of what you have might reveal some obvious mistake affecting power. You should be powering everything from 5V.
I’m a bit confused about your ability level in writing code, what you posted and your existing knowledge of VBA suggests to me you know how to write code, but are not familiar with the quirks of writing C/C++ for a micro-controller, is that about right?
Perhaps I will put a time check in the loop, like ensure that more than xx time goes by before running the loop.
Delaying loop() was only a suggestion as a test, you absolutely should not delay loop() by any means for normal operation, let it run freely.
Do you know about using millis() to schedule things to happen at particular intervals without stopping other things from happening? For updating a display you need to do one of 2 things:
Preferably set flags when something changes then use the flags to tell your display update code to send the updates. The obvious example being for a clock you set a flag every time the seconds counter increments then use the flag to tell the display update function to send the current time to the display.
Alternatively use a millis() based timer to send changes to the display at appropriate intervals. What counts as ‘appropriate’ is going to depend on the project, but keep in mind that a display is for a human to read and if it updates faster than it can be read then it is updating too fast.
All my sample code in my tutorials is written to obey the above principals, so study that.
I could not figure out how to attach the hmi to this post so I modified my original.
I suspect you replied by typing in the reply box below the last answer. Instead if you click the button you should have options for attachments shown. You can go back and edit a post to add attachments, click on /