Dosing Pump w/ .9.9 Question

Do you have a question on how to do something.
Ask in here.
Post Reply
chase
Posts: 101
Joined: Fri Sep 16, 2011 8:26 am

Dosing Pump w/ .9.9 Question

Post by chase »

My dosing pump code is rather long/outdated. I noticed several changes to this function. Just curious if there's a cleaner way to do it than my current code, which has them turn on at midnight dosing 2-3 secs every hour until 6am. I was hoping to use the new DosingPump/DosingPumpRepeat functions to dose the same intervals, only starting at 10pm instead of midnight. Here's my current code (which doesn't take into account dosing before midnight):

Code: Select all

//Dose Alk
                   if ( ReefAngel.DisplayedMenu == DEFAULT_MENU ) //Alk Doser - Only works if Main screen is showing
              {
              /*  && = and || = or
               Hours between 12:05am and 6:05am
               minute must be 0 (top of the hour)
               seconds less than 3 (up to 3 seconds)
               */ 
              if ( ((hour() >= 0) && (hour() <= 6)) && (minute() == 5) && //dose time
                   (second() < 3) ) //dose duration
               {
                  ReefAngel.Relay.On(AlkDoser);
               }
               else
               {
                  ReefAngel.Relay.Off(AlkDoser);
               }
            }  
If this is still the way to do it that's fine, I just wasnt sure how start at 10 pm since using

Code: Select all

if ( ((hour() >= 22) && (hour() <= 6)) && (minute() == 5)
didn't seem to work for starting at 10.
Thanks!
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dosing Pump w/ .9.9 Question

Post by rimai »

It has to be

Code: Select all

if ( ((hour() >= 22) || (hour() <= 6)) && (minute() == 5)
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Dosing Pump w/ .9.9 Question

Post by DrewPalmer04 »

Chase try that out and let me know. My dosing has been a little weird since 9.9 as well. I'm using the code Roberto posted above but my dosing has been way less overnight versus before 9.9 libs (I have my holding containers marked in 10mL intervals)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
chase
Posts: 101
Joined: Fri Sep 16, 2011 8:26 am

Re: Dosing Pump w/ .9.9 Question

Post by chase »

Great thanks for the quick reply! I'll give it a try once I have a chance to monitor it as well and post my results. Messing with dosing routines is always scary! =)(
Image
Post Reply