Page 1 of 1
Understanding Custom Variables
Posted: Fri Jun 05, 2015 7:11 am
by ewaldsreef
Looking for someone who has made use of custom variables in the code. I am playing with an I/O expansion and trying to learn. Are there any good treads I can read on this topic?
Re: Understanding Custom Variables
Posted: Fri Jun 05, 2015 8:54 am
by rimai
You can use them as additional info you want to show on the portal.
For example, I use it to show the moon cycle for the day.
Some others have used them for dosing counter and timer.
So, basically you can use it for anything you have in mind that you may want to track.
You can also use it as triggers to a custom function. For example, to trigger a lightning storm or a DIY fish feeder.
Re: Understanding Custom Variables
Posted: Fri Jun 05, 2015 10:26 am
by ewaldsreef
Can you post some code with an example? Sounds like fun
Re: Understanding Custom Variables
Posted: Fri Jun 05, 2015 10:29 am
by rimai
I use it like this:
Code: Select all
ReefAngel.CustomVar[1]=MoonPhase();
ReefAngel.CustomVar[7]=255;
Re: Understanding Custom Variables
Posted: Sat Jun 06, 2015 6:39 am
by cosmith71
I use it to show my dosing amounts, frequency, etc.
Code: Select all
// ******************* Assign custom variables for reporting on the portal *******************
ReefAngel.CustomVar[0]=Dosage; // Total amount per day
ReefAngel.CustomVar[1]=Doses; // Number of daily doses
ReefAngel.CustomVar[2]=Dispense; // Amount per dose to dispense
ReefAngel.CustomVar[3]=(1440/Doses)/60; // Hours between doses
ReefAngel.CustomVar[4]=(1440/Doses)%60; // Leftover minutes between doses
Re: Understanding Custom Variables
Posted: Sun Jun 07, 2015 7:27 am
by lnevo
I have a function adjustAlk that if you use the wifi to set the custom variable it will do things accordingly. Check that function in my INO. I got it from AlanM
Re: Understanding Custom Variables
Posted: Mon Jun 08, 2015 8:33 pm
by ewaldsreef
Hopefully I will have some more time to play with the programing next week. Just finishing up little legue season for my boys.
One thing I would like to add to my code will be the option to top off with kalk vs regular ro depending on ph reading.
Lnevo, I seem to remember in your code you had an alart for full skimmer cup. I also would like to add that.
Thank you everyone for your help.