Hi there,
I am planning on putting a return pump on port 1 and a skimmer pump on port 2. If I set them to always on with RAGen will they turn off during feeding mode? The feeding mode allows you to toggle specific ports from what I can tell.
I am going to add a temp probe to the heatsink for the LED's. How do I code a port to turn on when the temp rises to a certain point and off when it drops to a given temp? Havent been able to find anything on that.
Lastly, If I use a PWM slope for the LED's can I use the standard lights to bring on the moonlights?
Thanks for the help
Toggling a port off during feeding
-
binder
- Posts: 2865
- Joined: Fri Mar 18, 2011 6:20 pm
- Location: Illinois
- Contact:
Re: Toggling a port off during feeding
http://forum.reefangel.com/viewtopic.php?f=7&t=595grafspee1217 wrote:Hi there,
I am planning on putting a return pump on port 1 and a skimmer pump on port 2. If I set them to always on with RAGen will they turn off during feeding mode? The feeding mode allows you to toggle specific ports from what I can tell.
Yes, if you have the port selected to toggle for feeding mode then it will be turned off when feeding mode is entered and turned back on when feeding mode is exited.
If you are using the latest libraries (0.9.0 or later), you would do something like this:I am going to add a temp probe to the heatsink for the LED's. How do I code a port to turn on when the temp rises to a certain point and off when it drops to a given temp? Havent been able to find anything on that.
Code: Select all
void loop()
{
// rest of code functions
if ( ReefAngel.Params.Temp[T2_PROBE] > 890 ) {
// if probe 2 is greater than 89.0 degrees F, turn off port 1
ReefAngel.Relay.Off(Port1);
} else {
// otherwise the temp is below 89.0 F, so keep port 1 on
ReefAngel.Relay.On(Port1);
}
// rest of code functions
ReefAngel.ShowInterface();
}
Depends on how your moonlights are connected. If your moonlights just use a regular relay / outlet, then yes you can. You can either do it one of 2 ways. You can use StandardLights and have that schedule be your overnight schedule OR you can have StandardLights be your normal daytime schedule and use the MoonLights function. That would be coded like this:Lastly, If I use a PWM slope for the LED's can I use the standard lights to bring on the moonlights?
Thanks for the help
Code: Select all
ReefAngel.MoonLights(Port4);-
grafspee1217
- Posts: 84
- Joined: Sun Mar 11, 2012 10:38 am
Re: Toggling a port off during feeding
would this work?
void loop()
{
// rest of code functions
if ( ReefAngel.Params.Temp[T2_PROBE] > 1200 ) {
// if probe 2 is greater than 120.0 degrees F, turn on port 1
ReefAngel.Relay.on(Port1);
} else {
// otherwise the temp is below 120.0 F, so keep port 1 off
ReefAngel.Relay.off(Port1);
}
// rest of code functions
ReefAngel.ShowInterface();
}
void loop()
{
// rest of code functions
if ( ReefAngel.Params.Temp[T2_PROBE] > 1200 ) {
// if probe 2 is greater than 120.0 degrees F, turn on port 1
ReefAngel.Relay.on(Port1);
} else {
// otherwise the temp is below 120.0 F, so keep port 1 off
ReefAngel.Relay.off(Port1);
}
// rest of code functions
ReefAngel.ShowInterface();
}
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Toggling a port off during feeding
To make it easier, you can use this too:
But this is really not what you want to do it either.
This will just make whatever is on Port1 to keep toggling on/off multiple times.
What you really want to use is the StandardFan() function.
Use this instead:
Code: Select all
ReefAngel.Relay.Set(Port1,ReefAngel.Params.Temp[T2_PROBE] > 1200);
This will just make whatever is on Port1 to keep toggling on/off multiple times.
What you really want to use is the StandardFan() function.
Use this instead:
Code: Select all
ReefAngel.StandardFan(Port1,1150,1200); Turns Port1 on at 120.0F and off at 115.0F
Roberto.
-
grafspee1217
- Posts: 84
- Joined: Sun Mar 11, 2012 10:38 am
Re: Toggling a port off during feeding
Good point, it would toggle off at 119 and back on at 120
I can designate whatever port I want?
Does the controller ignore the comment after the ; or is the statement required?
Wouldn't the standard fan function be tied to probe 1 which is my tank's water temp?
I had planned on using probe 2 for the LED heatsink temp
I can designate whatever port I want?
Does the controller ignore the comment after the ; or is the statement required?
Wouldn't the standard fan function be tied to probe 1 which is my tank's water temp?
I had planned on using probe 2 for the LED heatsink temp
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Toggling a port off during feeding
Good point on the probe.
You can use the same guts of the function, which is this:
You can change the Port to whatever you choose. I just used Port1 as an example.
What tells the compiler that something is a comment is the //. Anything after it will be considered comment.
You can use the same guts of the function, which is this:
Code: Select all
if (Params.Temp[T2_PROBE] >= 1200) Relay.On(Port1); // If sensor 1 temperature >= HighTemp - turn on fan
if (Params.Temp[T2_PROBE] <= 1190) Relay.Off(Port1); // If sensor 1 temperature <= LowTemp - turn off fan
What tells the compiler that something is a comment is the //. Anything after it will be considered comment.
Roberto.
