RF and Feeding Mode
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
RF and Feeding Mode
For a custom menu to change modes after feed would it be something like
reefangel.feedmodestart()
Wdt reset
Set timer 30 min
If wdt >1
Reefangel.rf.usememory=false
Reefangel.rf.setmode(ntm,150,35)
Else
Reefangel.rf.usememory=true
I know it looks sloppy just trying to get an idea(typing on phone)
Also would you use the global variable I think its like 857(vortech mode) to display mode on main screen
reefangel.feedmodestart()
Wdt reset
Set timer 30 min
If wdt >1
Reefangel.rf.usememory=false
Reefangel.rf.setmode(ntm,150,35)
Else
Reefangel.rf.usememory=true
I know it looks sloppy just trying to get an idea(typing on phone)
Also would you use the global variable I think its like 857(vortech mode) to display mode on main screen
Re: RF Expansion Module
Not sure I understand what you are trying to accomplish.
The RA has a feeding mode built-in and it will put the vortechs on feeding mode too all by itself without the need of programming.
Yes, you can use the internal memory 855 for that.
The RA has a feeding mode built-in and it will put the vortechs on feeding mode too all by itself without the need of programming.
Yes, you can use the internal memory 855 for that.
Roberto.
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF Expansion Module
When I feed I power the vortechs down completely by relays so I can spot feed and not worry about using a bottle to contain the food around coral mandarins. After feed mode ends I manually put the vortechs in nutrient transport for 30-45 min to stir the uneaten food up to go out my overflow to be fed to my refugium. Basically I want to automate this. Feed mode > end feed mode vortech nutrient transport for 30min > back to reefcrest. I think I would have to reset the watchdog timer after feedmode is over since it uses it and give it a new countdown and as long as the timer is above 1 second the vortechs are in nutrient transport, hit 0 and it uses internal memory? Maybe I'm looking at this the wrong way
Re: RF and Feeding Mode
I think you can do it by using a variable to find out when feeding mode has ended and act when it did.
Something like this:
Declare a new boolean variable above setup():
Then, monitor the variable ReefAngel.DisplayedMenu and use Timer[4] to trigger RF back to internal memory settings:
Let me know if it works.
Something like this:
Declare a new boolean variable above setup():
Code: Select all
boolean bFeeding=false;
Code: Select all
if (ReefAngel.DisplayedMenu==FEEDING_MODE) bFeeding=true;
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding)
{
bFeeding=false;
ReefAngel.Timer[4].SetInterval(1800); // Timer for 30min
ReefAngel.Timer[4].Start();
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Smart_NTM,170,6);
}
if (ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.RF.UseMemory=true;
}
Roberto.
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
That makes more sense then what I was gonna try to do...why do I always avoid boolean statements they're so useful lol. Ill test it when I get off work thanks for your help as always roberto, you are the reef angel masta
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
hmm, this worked for the first day - now it doesnt :\
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
Nope :\ the only thing I've added to it is adding vtechmode global var for display on main screen
Code: Select all
if (ReefAngel.DisplayedMenu==FEEDING_MODE) bFeeding=true;
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding)
{
bFeeding=false;
ReefAngel.Timer[4].SetInterval(1800); // Timer for 30min
ReefAngel.Timer[4].Start();
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Smart_NTM,155,5);
vtechmode = 5;
}
if (ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.RF.UseMemory=true;
vtechmode = InternalMemory.RFMode_read();
}
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
Code: Select all
if (ReefAngel.DisplayedMenu==FEEDING_MODE) bFeeding=true;
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding)
{
bFeeding=false;
ReefAngel.Timer[4].SetInterval(1800); // Timer for 30min
ReefAngel.Timer[4].Start();
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Smart_NTM,155,5);
vtechmode = 5;
}
if (ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.RF.UseMemory=true;
vtechmode = InternalMemory.RFMode_read();
}
if ( hour() <= 6 || hour () >= 19 ) // Moonlights on from 7PM to 7AM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Night,15,0);
vtechmode = 9;
}
else
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.RF.UseMemory=true;
vtechmode = InternalMemory.RFMode_read();
}
Re: RF and Feeding Mode
That's the problem.
You are assigning UseMemory=false when the feeding ends, but the botttom statement puts it back to true when its between 6 and 19hrs.
You are assigning UseMemory=false when the feeding ends, but the botttom statement puts it back to true when its between 6 and 19hrs.
Roberto.
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
You mean when its not between 6 and 19? the two shouldnt interfere with each other because I dont feed when its night. and they both revert to using memory=true if its not night or not feeding...uh
Re: RF and Feeding Mode
Either way.
If it is between 6 and 19, you assign true and when it's not, you assign false and night mode.
So, either choice just override whatever it was previously assigned.
If you want the feeding with higher priority over the night more check, place the feeding code after the night mode check.
Whichever is the latest is the one that will take effect.
The other way is to merge them all, like you said, so there is always just one path to go.
If it is between 6 and 19, you assign true and when it's not, you assign false and night mode.
So, either choice just override whatever it was previously assigned.
If you want the feeding with higher priority over the night more check, place the feeding code after the night mode check.
Whichever is the latest is the one that will take effect.
The other way is to merge them all, like you said, so there is always just one path to go.
Roberto.
-
- Posts: 149
- Joined: Tue Nov 01, 2011 11:05 am
Re: RF and Feeding Mode
Gotta work on the merge, one after the other either way doesn't work. and I obviously need to take a lesson in multidimensional if/else structures because I've tried like 3 or 4 different ways of doing this and its blah