How to trigger an ATO Timeout Flag
-
- Posts: 89
- Joined: Thu Mar 08, 2012 5:11 pm
- Location: Redwood City, California
How to trigger an ATO Timeout Flag
Hi coding whizzes,
As part of my automatic water change system and new arrival acclimation system, I want my RA to act as if an ATO timeout has occurred without having to call the StandardATO or SingleATO functions. I'm sure there is an easy way to do this, but in my ignorance I couldn't find the answer with a quick search of the forum and I'm not sure where to look to figure this out. Could someone help me?
Thanks,
Gabe
As part of my automatic water change system and new arrival acclimation system, I want my RA to act as if an ATO timeout has occurred without having to call the StandardATO or SingleATO functions. I'm sure there is an easy way to do this, but in my ignorance I couldn't find the answer with a quick search of the forum and I'm not sure where to look to figure this out. Could someone help me?
Thanks,
Gabe
Re: How to trigger an ATO Timeout Flag
Inside your code somewhere, you would use this function:gaberosenfield wrote:Hi coding whizzes,
As part of my automatic water change system and new arrival acclimation system, I want my RA to act as if an ATO timeout has occurred without having to call the StandardATO or SingleATO functions. I'm sure there is an easy way to do this, but in my ignorance I couldn't find the answer with a quick search of the forum and I'm not sure where to look to figure this out. Could someone help me?
Thanks,
Gabe
Code: Select all
// Set the Timeout Flag
bitSet(ReefAngel.AlertFlags,ATOTimeOutFlag);
-
- Posts: 89
- Joined: Thu Mar 08, 2012 5:11 pm
- Location: Redwood City, California
Re: How to trigger an ATO Timeout Flag
Awesome, thanks binder!
One more question: How can I use the status of the ATO timeout flag as an input to another function? I had hoped that the answer to this question would be obvious to me after the first question was answered, but it is not...
I want to do something analogous to the following using the ATO timeout flag status instead of a boolean:
boolean trigger = false;
boolean functionThatReturns0or1()
{/*function code*/}
trigger = functionThatReturns0or1();
if (trigger == true)
{/*do something else*/}
One more question: How can I use the status of the ATO timeout flag as an input to another function? I had hoped that the answer to this question would be obvious to me after the first question was answered, but it is not...
I want to do something analogous to the following using the ATO timeout flag status instead of a boolean:
boolean trigger = false;
boolean functionThatReturns0or1()
{/*function code*/}
trigger = functionThatReturns0or1();
if (trigger == true)
{/*do something else*/}
Re: How to trigger an ATO Timeout Flag
Here's a few different ways. There may be some functions to read the flags directly rather than bitread, but not sure they are there yet. If not they should be
boolean trigger = bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag);
boolean functonThatReturns0or1()
{ return bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag); }
if ( bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag) )
{ /*do something else */}
boolean trigger = bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag);
boolean functonThatReturns0or1()
{ return bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag); }
if ( bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag) )
{ /*do something else */}
Re: How to trigger an ATO Timeout Flag
they are at least in the latest dev libraries from a while ago. i saw them last night while looking at the code. i can't remember the name off hand but it's something like isAtoFlagSet(). I would have to double check though.lnevo wrote:Here's a few different ways. There may be some functions to read the flags directly rather than bitread, but not sure they are there yet. If not they should be
Sent from my iPad mini
Re: How to trigger an ATO Timeout Flag
It's ReefAngel.isATOTimeOut();
Cool
Cool
-
- Posts: 89
- Joined: Thu Mar 08, 2012 5:11 pm
- Location: Redwood City, California
Re: How to trigger an ATO Timeout Flag
Sorry for the late reply everyone!
So ReefAngel.isATOTimeOut() will return a 1 if the ATO time out flag has been triggered and a 0 otherwise?
So ReefAngel.isATOTimeOut() will return a 1 if the ATO time out flag has been triggered and a 0 otherwise?
-
- Posts: 89
- Joined: Thu Mar 08, 2012 5:11 pm
- Location: Redwood City, California
Re: How to trigger an ATO Timeout Flag
Hmm, ReefAngel.isATOTimeOut() doesn't work for me. I must not have the latest development libraries or something... I must not know how to download them, cause I just downloaded what I thought were the latest libraries like 2 weeks ago. Unless this has been added since then... Oh well, I guess I can just use bitRead(ReefAngel.AlertFlags,ATOTimeOutFlag). Thanks so much!
Gabe
Gabe
Re: How to trigger an ATO Timeout Flag
Yes the new libraries were released today!
-
- Posts: 89
- Joined: Thu Mar 08, 2012 5:11 pm
- Location: Redwood City, California
Re: How to trigger an ATO Timeout Flag
I just downloaded the new libraries and now my code compiles using ReefAngel.isATOTimeOut(). I'm off to see if it works the way I want it to. Thanks for helping me!