Page 1 of 1

Re: Get count when relay is on or off

Posted: Thu Feb 01, 2018 5:57 am
by Armetas
rimai wrote:Sorry. Try this:

Code: Select all

static boolean control=false;
if (ReefAngel.Relay.Status(Port1)==true && control==false) 
{
  control=true;
  ReefAngel.CustomVar[0]++;
}
if (ReefAngel.Relay.Status(Port1)==false && control==true) 
{
  control=false;
}
Thank you. It works perfectly ;)

Re: Get count when relay is on or off

Posted: Thu Feb 01, 2018 5:58 am
by Armetas
binder wrote:
Armetas wrote:
binder wrote:custom variables are visible in my android app.

Sent from my XT1585 using Tapatalk
Only 7 are available and all of them are number which cannot exceed ~300
I would like to have more variables shown on android app or have them as text (as I'm trying to display some information for reporting failures in my reef)
Ahhhh... gotcha. the libraries would have to be modified to allow for larger values or to display text instead.
most likely it would have to be additional custom variables added instead of the same ones...or maybe not (at least for getting larger values). the text would require separate variables.

Sent from my XT1585 using Tapatalk
Is there a way who could change the libraries for such purpose. And how about android app? Will it handle longer variables? Or even text?

Get count when relay is on or off

Posted: Thu Feb 01, 2018 12:34 pm
by binder
Armetas wrote:
Is there a way who could change the libraries for such purpose. And how about android app? Will it handle longer variables? Or even text?
yes, it is possible to change the libraries around to do this. what i would suggest is creating a separate discussion topic/thread that we can discuss it in more detail of what you are wanting to accomplish. then we can create a testing branch for the libraries to test out functionality. if all goes well, then the changes could get merged into the main branch of the libraries.
then i could find some time to create a special build of my android app to help test and display the variables.
so that’s how i would suggest handling this so there’s a clear, open discussion on what is desired and we can move forward from there.


Sent from my iPad using Tapatalk

Re: Get count when relay is on or off

Posted: Thu Feb 01, 2018 12:36 pm
by rimai
Why don't you just use alert emails for that?
You can type anything on email alerts.

Re: Get count when relay is on or off

Posted: Thu Feb 01, 2018 12:38 pm
by binder
and yes, roberto’s idea would be the simplest and easiest to do.

one issue with sending text is the size. the more text on the controller, the bigger the code and harder it is to maintain. you are also limited with the options and changing them is harder. the email alerts are changed much easier without modifying the libraries.


Sent from my iPad using Tapatalk

Re: Get count when relay is on or off

Posted: Thu Feb 01, 2018 12:47 pm
by Armetas
rimai wrote:Why don't you just use alert emails for that?
You can type anything on email alerts.
But email alerts are outside the controller. Im writing code in the arduino ir order to track some things to catch when there is a problem and even now my all custom variables are fully occupied, im even saving like 31, 32, 120 values which represent for example: 32 - water in issue when changing water on 3rd time. I hope that you get what im trying to achieve