Dosing Kalk for 1min Every 30min

Do you have a question on how to do something.
Ask in here.
Post Reply
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

Could someone help me code this?
I would like port 4 to activate my stand alone ATO for 1min every half hour starting at 2am and stopping at 10am.
Thank You
Image
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

Does anyone have a code similar to this that I could modify? If I see the code maybe I can then figure out how to modify the port and times.

Any help would be great!

Thanks
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Kalk for 1min Every 30min

Post by lnevo »

You could use the following

Code: Select all

if ( (hour() >=2) && (hour() <10) )
  ReefAngel.Relay.Set(Port4, now()%1800<60);
else
  ReefAngel.Relay.Off(Port4);
There's some explanation of how that works in this thread... http://forum.reefangel.com/viewtopic.php?f=3&t=2612
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

Awesome! Thanks so much. It looks like you have already made the editing for me. Im not sure I would have been able to grasp that on my own.
Image
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

I'm guessing I won't be able to see the activity in the portal since the cycle is only 30 seconds?
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Dosing Kalk for 1min Every 30min

Post by lnevo »

Nope
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

:( Its obviously working since my water level is correct!! :)
Image
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

Today I checked relay activity and I was able to see 2 blips at 2:01 and 2:31...but no other? Any clue why this is?
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Dosing Kalk for 1min Every 30min

Post by lnevo »

Random luck...
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

Sweet!
Image
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

It seems Im falling behind on the ATO at this rate. If I wanted to change to dose length would I be correct in changing the BLUE and the frequency of the dosing
if ( (hour() >=2) && (hour() <10) )
ReefAngel.Relay.Set(Port4, now()%1800<60);
else
ReefAngel.Relay.Off(Port4);
I have already changed it from times 1am-12pm. Still not catching up. This morning I changed the 1800 to 900 which should mean 15min. Im undecided on which I should change to have a better impact on curving pH at night. Maybe leave the 1800 and dose for 2min?? Currently Im not raising the pH just "helping the down slope".
Feel free to chime in! Thanks
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Dosing Kalk for 1min Every 30min

Post by lnevo »

You could change the <60 to <120 to make it dose for two minutes instead of one...
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

If I want to run this overnight from pm to am. What is the easiest way to do so? Ive seen something on here about the PWM "overnight" function. Is there a sample of this for a relay?

I would like to start at 8pm (20) and end the next morning at 11am (11) every 15min for 20sec

Would I have to do 2 lines? Is there a way to shrink my code? I was thinking this:

if ( (hour() >=20) && (hour() <=23,59) )
ReefAngel.Relay.Set(Port4, now()%900<20);
else
ReefAngel.Relay.Off(Port4);

if ( (hour() >=0) && (hour() <=11) )
ReefAngel.Relay.Set(Port4, now()%900<20);
else
ReefAngel.Relay.Off(Port4);
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Kalk for 1min Every 30min

Post by lnevo »

You could do this...which woudl cover both scenario..


if (hour() >=20 || hour() < 11) Greater than 20 or less then 11 (ending at 10:59)
Paulturner911
Posts: 287
Joined: Wed Jan 23, 2013 12:36 pm

Re: Dosing Kalk for 1min Every 30min

Post by Paulturner911 »

I see!! one of those OR logics!!! lol

Thanks Im gonna run with that!
Image
Post Reply