Mask relay off

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Mask relay off

Post by DrewPalmer04 »

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.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

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.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

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.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

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...
}
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

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
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

lnevo 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...
}
Thanks so much for the help/idea though :)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

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...
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

I was answering how to do stuff when feeding mode is done...like set a mask :)
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Oh thanks!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

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;
}
}
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

The feed timer doesn't update in memory as its counting down...
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Cool. Didn't know. It looked simpler.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

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

Post by Piper »

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?

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;
}
If you want to make it even easier you can just trigger it when you enter into feeding mode.

Code: Select all

// Turn off the skimmer when we go into feeding mode
if (ReefAngel.DisplayedMenu==FEEDING_MODE) ReefAngel.Relay.RelayMaskOff=~Port4Bit;
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.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Thanks! I'll use the second idea!!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

It masked off ports 1-4 when ==feeding mode?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Piper wrote: [/code]

If you want to make it even easier you can just trigger it when you enter into feeding mode.

Code: Select all

// Turn off the skimmer when we go into feeding mode
if (ReefAngel.DisplayedMenu==FEEDING_MODE) ReefAngel.Relay.RelayMaskOff=~Port4Bit;
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.
Used this.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Mask relay off

Post by lnevo »

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...
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Yeah I'd prefer it too. The syntax above only applies mask from 1-4 during feeding mode then ends (for obvious reasons)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Until then. I'll just use the good ol iPhone app :P
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Mask relay off

Post by rimai »

Feeding mode already applies a mask off.
All you need is this:

Code: Select all

  ReefAngel.FeedingModePorts = Port4Bit;
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

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.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Mask relay off

Post by rimai »

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.
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Mask relay off

Post by DrewPalmer04 »

Ok thanks!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
Post Reply