Hi, my project is based on cyclic soil moisture measurements using 8 sensors and depending on the exceeding of the humidity drop - watering the plants by activating the water pump and the correct solenoid valve.
What I want to accomplish: remove all “delays” from the code, especially the loops, and replace it with the millis () function. Unfortunately, these delays are required due to the accuracy of the measurement and the need to water for a certain period of time (or maybe there is another solution to remove the delays?).
I would like the functions (for measurements made with sensors) to be still activated by the timer.
My guess is that I could do this by dropping the code into the main loop, but good practice is to keep the main loop as slim as possible.
Below I am pasting my code.
I will be very grateful for any advice!