Understanding Custom Variables

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
ewaldsreef
Posts: 82
Joined: Tue Oct 08, 2013 8:22 pm
Location: Salt Lake City, UT
Contact:

Understanding Custom Variables

Post 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?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Understanding Custom Variables

Post 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.
Roberto.
User avatar
ewaldsreef
Posts: 82
Joined: Tue Oct 08, 2013 8:22 pm
Location: Salt Lake City, UT
Contact:

Re: Understanding Custom Variables

Post by ewaldsreef »

Can you post some code with an example? Sounds like fun
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Understanding Custom Variables

Post by rimai »

I use it like this:

Code: Select all

  ReefAngel.CustomVar[1]=MoonPhase();
  ReefAngel.CustomVar[7]=255;
Roberto.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Understanding Custom Variables

Post 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
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Understanding Custom Variables

Post 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
User avatar
ewaldsreef
Posts: 82
Joined: Tue Oct 08, 2013 8:22 pm
Location: Salt Lake City, UT
Contact:

Re: Understanding Custom Variables

Post 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.
Image
Post Reply