Following on from a previous post I have now completed my Reverse Osmosis Controller. 90% of it works fine except for the last part which is the override button.
Sketch Brief (using the stage abbreviations in my sketch)
1/ OFF - idle position directed to SWAP3.
2/ SWAP3 - if FlagSW(switch) is HIGH proceed to FLAG else proceed to FSWT.
3/FSWT - FLUSH1 - FLUSH1TIME - FLUSH1END - SWAP1 - FLUSH2 - FLUSH2TIME - FLUSH2END - SWAP2 - RUN - RUNEND - this process is a FSWT(float switch) activates a booster pump and 2 types of flushes are carried out prior to the production of pure water then FSWT de-activates and the stae returns to OFF.
4/FLAG - if FlagSW(switch) is high, the boostePump & FROW(selenoid) are high and pure water is being produced. This state should not be influenced by the TankFSW(float switch).
5/FLAGTIMEON - if 30 minutes have passed and the FlagSW(switch) is still HIGH procced to FLAGOFF else proceed to OFF.
6/FLAGOFF - turn everything off proceed to FLAGTIMEOFF
7/FLAGTIMEOFF - if 10 minutes have passed and the FlagSW(switch) is HIGH procced to FLAG else proceed to OFF.
The part which does not seem to work as it shoud is from SWAP3 - FLAG - FLAGTIMEON - FLAGOFF - FLAGTIMEOFF - OFF.
Can someone please have a look at my code and advise me where am i going wrong please.
AQUA_PRO_RO_Controller.ino (5.95 KB)