Values passed to Relay.DelayedOn
Values passed to Relay.DelayedOn
In addition to setting a 1 minute delay to:
ReefAngel.Relay.DelayedOn(Port1, 1);
I would also like to set a schedule for on/off times.
Is this possible? What are the values the function accepts? OR Where can I find them in the code?
Thanks!!
Jim
ReefAngel.Relay.DelayedOn(Port1, 1);
I would also like to set a schedule for on/off times.
Is this possible? What are the values the function accepts? OR Where can I find them in the code?
Thanks!!
Jim
_____
Jim
Jim
Re: Values passed to Relay.DelayedOn
The ReefAngel.Relay.DelayedOn function accepts the port as the first argument and the time of the delay as the second argument. Will it accept additional arguments such as time on/time off?rimai wrote:Can you explain a little more?
_____
Jim
Jim
Re: Values passed to Relay.DelayedOn
Oh, no it won't.
So, you would like have the port work on time schedule, but if it is stopped by feeding/water change mode or power cycle, it should delay start, is that it?
So, you would like have the port work on time schedule, but if it is stopped by feeding/water change mode or power cycle, it should delay start, is that it?
Roberto.
Re: Values passed to Relay.DelayedOn
couldn't you just enclose this in an if statement based on the hour?
Re: Values passed to Relay.DelayedOn
Correct!rimai wrote:Oh, no it won't.
So, you would like have the port work on time schedule, but if it is stopped by feeding/water change mode or power cycle, it should delay start, is that it?
_____
Jim
Jim
Re: Values passed to Relay.DelayedOn
One easy way to do this would be leaving the function the way it is and use another one to turn it off when it is within the timeframe for turn off.
So, use this:
Try this out and see if it works for you.
So, use this:
Code: Select all
ReefAngel.Relay.DelayedOn(Port1, 1);
if (NumMins(hour(),minute()) <= NumMins(8,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 before 8am
if (NumMins(hour(),minute()) >= NumMins(22,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 after 10pm
Roberto.
Re: Values passed to Relay.DelayedOn
rimai wrote:One easy way to do this would be leaving the function the way it is and use another one to turn it off when it is within the timeframe for turn off.
So, use this:Try this out and see if it works for you.Code: Select all
ReefAngel.Relay.DelayedOn(Port1, 1); if (NumMins(hour(),minute()) <= NumMins(8,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 before 8am if (NumMins(hour(),minute()) >= NumMins(22,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 after 10pm
Thanks!!
_____
Jim
Jim
Re: Values passed to Relay.DelayedOn
Don't we need code to turn it on?rimai wrote:One easy way to do this would be leaving the function the way it is and use another one to turn it off when it is within the timeframe for turn off.
So, use this:Try this out and see if it works for you.Code: Select all
ReefAngel.Relay.DelayedOn(Port1, 1); if (NumMins(hour(),minute()) <= NumMins(8,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 before 8am if (NumMins(hour(),minute()) >= NumMins(22,0)) ReefAngel.Relay.Off(Port1) // Turn off Port1 after 10pm
_____
Jim
Jim
Re: Values passed to Relay.DelayedOn
Hum.. you are right, but that would also disable the DelayedOn() function.
So I guess we scratch this code.
Try this one instead:
So I guess we scratch this code.
Try this one instead:
Code: Select all
if (NumMins(hour(),minute()) >= NumMins(8,0) && NumMins(hour(),minute()) <= NumMins(22,0)) ReefAngel.Relay.DelayedOn(Port1, 1); else ReefAngel.Relay.Off(Port1);
Roberto.