Page 1 of 1

How to code second ph probe

Posted: Wed Jun 27, 2012 2:06 pm
by carlii
Ok, So I got my second ph probe in today and installed it. Sooooo. It is not showing up on the portal as installed. How can I tets teh installation. I don't see a custom main screen in teh example codes as teh manual suggests. I tried downloadin the new Windows installer to no avail.

I want my system setup so that it displays the ph probe from the tank(ph probe 2) as the main ph probe, and the Calc reactor(probe 1) as a CO2 controller. This is because I don't have enough cable to run from teh tank to the RA controller.

So my questions are 3:

1. Can I switch the ph probe that is shown on the web banner to reflect the second probe? Or better yet, both probes?

2. How do I create a custom screen on my RA that shows both ph probes?

3. Is there anything special about that ph probe coaxial cable in case I just have to extend it to swap them?

Thanks in advance.

Re: How to code second ph probe

Posted: Wed Jun 27, 2012 2:35 pm
by rimai
1. No, we need to design new banners to accomodate the new expansion modules.
None of the modules show up on banners yet. It will eventually. I just need to adjust the design of all banners.
2. The new example code will be included in the next release of libraries. I'm just waiting for a couple things to get finalized to be able to release them. should be out by the end of the week.
If you want to use a pre-release, pm me and I'll send them to you.
3. There is nothing special. You can use your own or get one from the webstore.

Re: How to code second ph probe

Posted: Wed Jun 27, 2012 8:24 pm
by carlii
Ok thanks.

Now the question I forgot to ask. How do I address the second probe in my code so that I can use it for my calc reactor?

Re: How to code second ph probe

Posted: Wed Jun 27, 2012 8:38 pm
by rimai
Try this:

Code: Select all

    if (ReefAngel.Params.PHExp <= 670) Relay.Off(Port1);
    if (ReefAngel.Params.PHExp >= 690) Relay.On(Port1);

Re: How to code second ph probe

Posted: Thu Jun 28, 2012 6:25 am
by carlii
I get the following error unpon complile:

carl_angel_ai:99: error: 'struct ParamsStruct' has no member named 'PHExp'
carl_angel_ai:100: error: 'struct ParamsStruct' has no member named 'PHExp'

Am I missing something from my feature file or define statement?

// Autogenerated file by RAGen (v1.2.2.171), (05/04/2012 20:41)
// RA_050412_2041.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define DisplayImages
#define WavemakerSetup
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define ATOSetup
#define wifi
#define ENABLE_ATO_LOGGING
#define AI_LED
#define RelayExp
#define InstalledRelayExpansionModules 1
*/


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <AI.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here
byte x,y;
char text[10];


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller

ReefAngel.AI.SetPort(highATOPin);

ReefAngel.FeedingModePorts = Port6Bit | Port2Bit | Port5Bit; // Ports toggled in Feeding Mode

ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit; // Ports turned off when Overheat temperature exceeded

ReefAngel.LightsOnPorts = Port3Bit | Port4Bit; // Ports toggled when Lights On / Off menu entry selected

ReefAngel.OverheatProbe = T1_PROBE; // Use Temperature probe 1 to check for overheat



// Ports that are always on
ReefAngel.Relay.On(Port2); //return pump
ReefAngel.Relay.On(Box1_Port1); //Skimmer
ReefAngel.Relay.On(Box1_Port6); //Calcium Reactor Pump


////// Place additional initialization code below here




////// Place additional initialization code above here
}

void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.SingleATO(true,Port1,600,1); //Setup Port1 as Auto Top-Off function with 15m timeout 1 time per hour
ReefAngel.WavemakerRandom1(Port5,15,60);
ReefAngel.WavemakerRandom2(Port6,15,50);

ReefAngel.StandardLights(Port3,8,50,20,01); //MainLED schedule 8:30am - 8:30pm
ReefAngel.StandardLights(Port4,8,50,20,01); //MainLED schedule 8:30am - 8:30pm
ReefAngel.StandardHeater(Box1_Port7,788,792); // Setup Heater to turn on at 78.8F and off at 79.2F
////// Place your custom code below here


ReefAngel.AI.SetChannel(White,PWMParabola(10,0,18,30,15,45,0));
ReefAngel.AI.SetChannel(Blue,PWMParabola(9,00,18,45,5,45,0));
ReefAngel.AI.SetChannel(RoyalBlue,PWMParabola(9,30,19,00,5,45,0));



if ( ReefAngel.Params.PHExp < 650 ) ReefAngel.Relay.Off(Box1_Port4); //CO2 Switch
if ( ReefAngel.Params.PHExp >= 680 ) ReefAngel.Relay.On(Box1_Port4); //CO2 Switch

ReefAngel.StandardLights(Box1_Port8,20,30,04,30); //Refugium schedule 08:30pm - 4:30am

if (ReefAngel.Params.Temp[T3_PROBE] > 850) ReefAngel.Relay.On(Box1_Port2); // Canopy Fans on
if (ReefAngel.Params.Temp[T3_PROBE] < 820) ReefAngel.Relay.Off(Box1_Port2); // Canopy Fans off



if ( hour() >= 19 && hour () <= 21 ) // Moonlights on from 8:00PM to 10PM
{

ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
else if ( hour() >= 7 && hour () <= 9 ) // Moonlights on from 7:00AM to 9AM
{

ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}

else
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}



////// Place your custom code above here
// This sends all the data to the portal

ReefAngel.Portal("#####", "#######");
// Do not add any custom code that changes any relay status after this line
// The only code after this line should be the ShowInterface function


// This should always be the last line
ReefAngel.ShowInterface();
}

Re: How to code second ph probe

Posted: Thu Jun 28, 2012 7:33 am
by rimai
Like I said before, the new libraries are not out yet.
I can provide you with pre-release of them or you can just wait a couple more days for me to finalize the update.