Help coding ATO

Do you have a question on how to do something.
Ask in here.
Post Reply
mrwlf
Posts: 17
Joined: Thu Feb 13, 2014 8:10 am

Help coding ATO

Post by mrwlf »

Hi i need help to generate a code for my old first generation Reef Angel.

Using wizard i generated this code that is almost ready for my needs except for the Ato.

I would like to use the two floating switches like this:

First as Ato that activate port 3 (and i did it with the wizard)

Second switch to Activate port 4 ti fill my water reservoir

How do i code it?
Thanks

Here is my actual code

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>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.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
    ReefAngel.SetTemperatureUnit( Celsius );  // set to Celsius Temperature

    ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port3Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port2Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 300 );


    // Ports that are always on

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

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

void loop()
{
    ReefAngel.StandardHeater( Port1,245,255 );
    ReefAngel.StandardLights( Port2,9,0,19,0 );
    ReefAngel.SingleATO( true,Port3,60,0 );
    ReefAngel.Relay.DelayedOn( Port8,1 );
    ////// Place your custom code below here
    

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

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

rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help coding ATO

Post by rimai »

Sorry, I didn't understand the concept.
How do you want to use the second switch?
Is it just like a second ATO for your water reservoir?
Roberto.
mrwlf
Posts: 17
Joined: Thu Feb 13, 2014 8:10 am

Re: Help coding ATO

Post by mrwlf »

Thanks for your help...

I'll need the second switch as ATO for my water reservoir but without Timeout.

Will this work?

Code: Select all

ReefAngel.Relay.Set( Port4, ReefAngel.HighATO.IsActive());
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help coding ATO

Post by rimai »

Yes :)

Sent from my Galaxy S3 using Tapatalk
Roberto.
mrwlf
Posts: 17
Joined: Thu Feb 13, 2014 8:10 am

Re: Help coding ATO

Post by mrwlf »

Thanks
Post Reply