Page 1 of 1

I/O Expansion module code

Posted: Sat Jun 07, 2014 6:07 am
by Armetas
Hi,

I've bought I/O expansion module, but after connecting it I don't know what to do next...

I have 5 float switches. I will use them to monitor all my tank water levels.

1 - Low
2 - High
3 - Low
4 - High
5 - Low

Now I don't know how to add custom screen to my RA and how to setup such functionality for float switches.
So basically what I need:

1) code which will add new page in my current screen
2) code which control float switches as mentioned above

Maybe someone can help?

Thanks in advance.

Re: I/O Expansion module code

Posted: Sat Jun 07, 2014 8:22 am
by rimai
The new 2014 screen adds it automatically. Place this in your setup():

Code: Select all

  ReefAngel.Use2014Screen();
Then, use something like this in loop():

Code: Select all

ReefAngel.CustomVar [0]=0; // Initial value. Anything other than 0 means an alert.
ReefAngel.CustomVar [7]=255; // This is a dummy to make sure the Custom Variables is always enabled in the Portal 
if ( ReefAngel.IO.GetChannel(1) ) ReefAngel.CustomVar [0]=1;
if ( !ReefAngel.IO.GetChannel(2) ) ReefAngel.CustomVar [0]=2;
if ( ReefAngel.IO.GetChannel(3) ) ReefAngel.CustomVar [0]=3;
if ( !ReefAngel.IO.GetChannel(4) ) ReefAngel.CustomVar [0]=4;
if ( ReefAngel.IO.GetChannel(5) ) ReefAngel.CustomVar [0]=5;
In the portal, you can set a trigger for C0>0.

Re: I/O Expansion module code

Posted: Sun Jun 08, 2014 12:23 am
by Armetas
Thanks. And how to change labels for I/O channels?

Re: I/O Expansion module code

Posted: Sun Jun 08, 2014 7:54 am
by rimai
In the portal or in the screen?

Re: I/O Expansion module code

Posted: Sun Jun 08, 2014 8:04 am
by Armetas
In the screen

Re: I/O Expansion module code

Posted: Sun Jun 08, 2014 10:06 am
by rimai
Sorry, not available yet :(
Can you create an issue request on our github, so we can work on this for future releases?
https://github.com/reefangel/libraries/issues/