RA Plus + Vortechs

Do you have a question on how to do something.
Ask in here.
Post Reply
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

RA Plus + Vortechs

Post by ecam »

Hello. Needed some help with a few things i want to do in my code:

1.) Display current Vortech mode and speed in my display and wifi menu
2.) Switch between Sync and Anti snych mode for 3 hrs a day and then into Nutrient mode for another 3 hrs and back to Reef crest mode
3.) Change the name of my outlets to custom names....
i.e: Port 4 = ATO Pump
and name the temp probes like
t1 = Sump
t2 = 120
t3 = 57

Thanks in advance for the help

Code: Select all

#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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>fa
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

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


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
 ReefAngel.WaterChangePorts = Port1Bit | Port8Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
  ReefAngel.FeedingModePorts = Port1Bit | Port6Bit | Port8Bit; // Turn off Ports 1, 6, 7 and 8 when Water Change Mode is activated
  ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit| Port5Bit;
  ReefAngel.OverheatShutoffPorts = Port2Bit |Port3Bit | Port4Bit | Port5Bit | Port7Bit; // Turn off Ports 3,
    ReefAngel.TempProbe = T3_PROBE;
    ReefAngel.OverheatProbe = T3_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );

    // Setup ATO Port for AI communication
    ReefAngel.AI.SetPort( lowATOPin );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );


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

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

void loop()
{
    ReefAngel.Relay.Set( Port2, !ReefAngel.Relay.Status( Port5 ) );
    ReefAngel.StandardLights( Port3,11,0,15,0 );
    ReefAngel.StandardLights( Port4,11,0,20,0 );
    ReefAngel.StandardLights( Port5,9,0,19,0 );
    ReefAngel.StandardHeater( Port7,780,800 );
    ReefAngel.Relay.DelayedOn( Port8,2 ); //Skimmer
    ReefAngel.AI.SetChannel( White, PWMParabola(11,0,17,0,0,60,0) );
    ReefAngel.AI.SetChannel( Blue, PWMParabola(9,0,20,0,15,100,0) );
    ReefAngel.AI.SetChannel( RoyalBlue, MoonPhase()/5 );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( ReefCrest,85,10 );
    ReefAngel.RF.SetChannel( Radion_White, PWMParabola(9,0,20,0,0,60,0) );
    ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
    ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(9,0,20,0,15,65,15) );
    ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(9,0,20,0,15,50,15) );
    ReefAngel.RF.SetChannel( Radion_Blue, MoonPhase() );
    ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(9,0,20,0,15,94,15) );
    if ( second()==0 ) ReefAngel.RF.RadionWrite();


    ////// Place your custom code below here
    
    
         
     
        
    // Hardcode PH calibrations
     ReefAngel.PHMin=544; // PH7.0
     ReefAngel.PHMax=830; // PH10.0

    ////// Place your custom code above here

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Aqua Illumination
    x = 10;
    y = 20;
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
    for ( int a=0;a<3;a++ )
    {
      ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
      x += 38;
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 94, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA Plus + Vortechs

Post by rimai »

Where exactly you want to change names?
Sync and anti-sync is controlled by the vortech driver. Please refer to the ecotech manual on how to set it.
What are the times that you want to run NTM /Reefcrest/ any other mode?
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: RA Plus + Vortechs

Post by ecam »

On the reef angel display I want to name the temp probes as follows
T1= Sump
T2 = 57 SPS
T3 = 120 DT


If possible i want to build another mode like the "Water change mode" called "Sock Change" that would turn over just one of the pumps (port 6) - Cna i create this custom mode

Here is what i want to do with the vortech:

From 11:30pm to 6 am I want to run in Lagoon mode
from 6:01 to 11:am I want to go into Reefcrest mode
from 11am to 1pm I want the reef angel to switch the modes from Antisynch to Synch mode (currently im doing this manually, can the reef angel do it)
from 1:01 to 4pm i want to go into NTM and switch back to Antisynch mode
from 4:01 to 11pm I want to go back to reef crest mode
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: RA Plus + Vortechs

Post by ecam »

Any help?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA Plus + Vortechs

Post by rimai »

To change the main screen, you need to create a custom main screen:
http://forum.reefangel.com/viewtopic.php?f=14&t=109
To create a new mode, you will need to create a custom menu:
http://forum.reefangel.com/viewtopic.php?f=14&t=311
For the vortech, you can use something like this:

Code: Select all

ReefAngel.RF.UseMemory = false;
if (hour()>=6 && hour()<11)
  ReefAngel.RF.SetMode(ReefCrest,40,10);
else if (hour()>=11 && hour()<13)
  ReefAngel.RF.SetMode(ReefCrest,40,10);
else if (hour()>=13 && hour()<16)
  ReefAngel.RF.SetMode(Smart_NTM,50,15);
else if (hour()>=16 && hour()<23)
  ReefAngel.RF.SetMode(ReefCrest,40,10);
else
  ReefAngel.RF.SetMode(Lagoon,40,10);
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: RA Plus + Vortechs

Post by ecam »

Hey Roberto. Thanks. Where in the code is it toggling between sync and anti synch mode? Can this be done? Also. Just to be sure in the code. The syntax for the vortech command is
Mode, speed, duration. Right
I.e ntm, 85, 15.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA Plus + Vortechs

Post by rimai »

sync/anti-sync/back-of-tank has to be selected on your vortech driver. Please refer to ecotech manual.
yes, mode,speed,duration
Roberto.
Post Reply