Setting a timer on a port that is already controlled
Posted: Sun Jun 07, 2020 8:28 am
To better balance my daily alkalinity, I'm interested in turning off my Carbondoser (fancy solenoid connected to CO2 tank for my Ca reactor) for a few hours in the middle of the night. The problem is, this relay/port is already set for CO2 control, tied to the pH read by my PH Expansion module
I can set simple time if/then statements, but I figure that if I set the port to time-off at say 1:00 am and then time-on at say 4:00 am, it would create a conflict in that my CO2 control code is telling the port one thing (to turn on/off based on Internal Memory settings), while the if/then statements would be telling it to turn on at 4 am and remain on until 1 am. The way out of this is to set two "off" values creating a range
Is this the best way to accomplish?
Code: Select all
ReefAngel.CO2Control( Box1_Port1, InternalMemory.CO2ControlOff_read(), InternalMemory.CO2ControlOn_read(), true );
I can set simple time if/then statements, but I figure that if I set the port to time-off at say 1:00 am and then time-on at say 4:00 am, it would create a conflict in that my CO2 control code is telling the port one thing (to turn on/off based on Internal Memory settings), while the if/then statements would be telling it to turn on at 4 am and remain on until 1 am. The way out of this is to set two "off" values creating a range
Code: Select all
if ( hour(now()) >= 1 ) ReefAngel.Relay.Off( Box1_Port1 );
if ( hour(now()) <= 4 ) ReefAngel.Relay.Off( Box_Port1 );