I am writing a code to control my marine tank pumps and monitor the external water levels,
the code is working fine this is not a how too or cant work it out question,
The interface is via digital pins (level sensors) and digital outputs (Relays)
The Arduino Mega is interfaced with a Nextion EN 7", again this all works well and I can see the button presses coming in via the serial. THe hole package works
no with the issue, the code is part complete say 10-20%, thus the extra bytes and input/outputs not assigned as yet but the code is slow to cycle, about 1 second each loop (I changed an output to cycle each loop to test it)
as the code is very slow to cycle, it is missing the incoming bits from the Nextion (approx. 1 out of 10 presses change the state of the output), thus the Arduino is not acting on them. its only reading them if I happen to press the button when the code is in the right spot.
the sendCommands change the indications on the Nextion for the Pump and Level indicators.
is my formatting that wrong its slowing it down, can I somehow take some of the code out of the loop, have I completed the code “long hand” is there a better way, the rest of the code is repeats of the attached thus looking for help prior to writing it
Ben, thanks in advance******************
tanks.txt (10.2 KB)