Mask relay off
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Mask relay off
Any way to mask the relay off after feeding mode ends? Then I can choose when to turn the relay back on via my iPhone app. This is extra helpful for coral feeding when the skimmer should remain off. Not default back to on when the feeding mode ends.
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
You can use delayed on for that. Or if you look at my code, i have a section fir my vortech when i come out of feeding mode. You could use the same condition to enable a mask.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Delay on is messing with my RTC tinkering lol so no go there. How do I look at your code? I'd like for the mask to be applied only after feeding mode.
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
http://forum.reefangel.com/viewtopic.php?p=17807#p17807
Essentially this code here:
// Enable Feeding Mode flag
if (ReefAngel.DisplayedMenu==FEEDING_MODE) isFeeding=true;
// Here's what we do if we're just out of feeding mode...
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && isFeeding) {
isFeeding=false;
feedDelay=true; // This will let us know we want some extra time before Smart_NTM
setRFtimer(30); // Start Smart_NTM in 30 minutes...
}
Essentially this code here:
// Enable Feeding Mode flag
if (ReefAngel.DisplayedMenu==FEEDING_MODE) isFeeding=true;
// Here's what we do if we're just out of feeding mode...
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && isFeeding) {
isFeeding=false;
feedDelay=true; // This will let us know we want some extra time before Smart_NTM
setRFtimer(30); // Start Smart_NTM in 30 minutes...
}
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
This would help with delaying more. But I'd love to just have it off until I hit the mask button on my iPhone to have it unmask the port, thus turn on the skimmer. But I'd like to have manual control to "undo" the mask when I'd like on the iPhone app. No set delay time
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Thanks so much for the help/idea thoughlnevo wrote:http://forum.reefangel.com/viewtopic.php?p=17807#p17807
Essentially this code here:
// Enable Feeding Mode flag
if (ReefAngel.DisplayedMenu==FEEDING_MODE) isFeeding=true;
// Here's what we do if we're just out of feeding mode...
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && isFeeding) {
isFeeding=false;
feedDelay=true; // This will let us know we want some extra time before Smart_NTM
setRFtimer(30); // Start Smart_NTM in 30 minutes...
}
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
Forget what im doing in th if loop.....
Just change the meat of the code to set the mask you want...
I set masks later on..look at what i do later on with the skimmer when return pump goes off or when atolow is active...
Just change the meat of the code to set the mask you want...
I set masks later on..look at what i do later on with the skimmer when return pump goes off or when atolow is active...
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
I was answering how to do stuff when feeding mode is done...like set a mask 
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
could I do this?
setup()
{
ReefAngel.CustomVar[0]=0;
ReefAngel.CustomVar[7]=255;
}
loop()
{
ReefAngel.CustomVar[0]=InternalMemory.read(FeedingTimer_read);
if ( ReefAngel.CustomVar[0]== 0 )
{
ReefAngel.Relay.RelayMaskOff=~Port4Bit;
}
}
setup()
{
ReefAngel.CustomVar[0]=0;
ReefAngel.CustomVar[7]=255;
}
loop()
{
ReefAngel.CustomVar[0]=InternalMemory.read(FeedingTimer_read);
if ( ReefAngel.CustomVar[0]== 0 )
{
ReefAngel.Relay.RelayMaskOff=~Port4Bit;
}
}
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
The feed timer doesn't update in memory as its counting down...
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Cool. Didn't know. It looked simpler.
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
What was wrong with the code i gave you coming out of feeding mode?
-
Piper
- Posts: 304
- Joined: Fri Jul 20, 2012 7:13 am
- Location: Oakley, CA
Re: Mask relay off
What lnevo posted should work just fine. I used the same think to make my own "poor mans's" nutrient export mode with with Koralia powerheads. Is it not doing what you want it to do?
If you want to make it even easier you can just trigger it when you enter into feeding mode.
I just happen to leave my skimmer running when I'm in feeding mode but I shut off the main pump. The skimmer basically processes sump water during feeding mode.
Code: Select all
// At the top where you define other globals set this:
boolean isFeeding = false;
Code: Select all
// Enable Feeding Mode flag
if (ReefAngel.DisplayedMenu==FEEDING_MODE) isFeeding=true;
// Here's what we do if we're just out of feeding mode...
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && isFeeding) {
isFeeding=false;
ReefAngel.Relay.RelayMaskOff=~Port4Bit;
}
Code: Select all
// Turn off the skimmer when we go into feeding mode
if (ReefAngel.DisplayedMenu==FEEDING_MODE) ReefAngel.Relay.RelayMaskOff=~Port4Bit;
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Thanks! I'll use the second idea!!
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
It masked off ports 1-4 when ==feeding mode?
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Used this.Piper wrote: [/code]
If you want to make it even easier you can just trigger it when you enter into feeding mode.I just happen to leave my skimmer running when I'm in feeding mode but I shut off the main pump. The skimmer basically processes sump water during feeding mode.Code: Select all
// Turn off the skimmer when we go into feeding mode if (ReefAngel.DisplayedMenu==FEEDING_MODE) ReefAngel.Relay.RelayMaskOff=~Port4Bit;
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Mask relay off
That syntax never worked for me which is why i use setbit/clearbit functions. Maybe roberto can chime in with the right syntax here. I would love to use the PortXBit variables this way instead too...
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Yeah I'd prefer it too. The syntax above only applies mask from 1-4 during feeding mode then ends (for obvious reasons)
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
Until then. I'll just use the good ol iPhone app 
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Mask relay off
Feeding mode already applies a mask off.
All you need is this:
All you need is this:
Code: Select all
ReefAngel.FeedingModePorts = Port4Bit;
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Mask relay off
I'm trying to find a way to have it permenarely mask off even when the feeding countdown reaches 0. This way I'll have control when I want to mask on the relay from my iPhone.
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Mask relay off
You will need to create a variable that holds the state of the feeding mode and then when feeding mode changes, you apply the mask again.
The controller will always remove the mask on feeding mode exit, no matter what.
The controller will always remove the mask on feeding mode exit, no matter what.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL