the sketch is part of a present for my neighbour. He wants to control the watering of his garden via his mobile phone.
I wrote a sketch, so he can turn the 2 valves manually on and off, or he can select a time after that the first valve turns off, the other turns on, and after the definied time the second valve turns off.
As add-on he can select an number of days, after that this should repeat (for beeing on holidays).
I tested it with short times (5 oder 10 minutes), and it worked fine.
Yesterday he told me, he tried it with 90 minutes for each valve, but the first valve did not close after 90 minutes, and the second valve did not open.
At first I thought, the problem is “int” and not “long” oder “unsigned long”. But that was not the reason of the fault.
It written for an ESP8266-01.
The basic of this sketch is 8266-Server from Rui Santos.
If you tab on the first line, you’ll get the actually time oder status of the valves.
Thanks for your help !
Petrus1.2.3-i.ino (13.4 KB)