Re: pH control linked to water level and timed safety
Posted: Mon Sep 11, 2017 2:20 pm
If i wanted to only dose the kalk for 2.5 minutes every 30 minutes, i just change the code above from 1800<150?
Community discussion about Reef Angel Controllers and reefing related subjects
http://forum.reefangel.com/
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 <PAR.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.Use2014Screen(); // Let's use 2014 Screen
ReefAngel.AddWaterLevelExpansion(); // Water Level Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port3Bit | Port8Bit;
ReefAngel.FeedingModePortsE[0] = Port1Bit | Port2Bit | Port4Bit | Port5Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit;
ReefAngel.WaterChangePortsE[0] = Port1Bit | Port2Bit | Port4Bit | Port5Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port3Bit | Port7Bit | Port8Bit;
ReefAngel.OverheatShutoffPortsE[0] = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 280 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Box1_Port1 );
ReefAngel.Relay.On( Box1_Port2 );
ReefAngel.Relay.On( Box1_Port5 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.PHControl( Port2,819,822 );
ReefAngel.Relay.DelayedOn( Port3,2 );
ReefAngel.StandardLights( Port4,9,0,19,0 );
ReefAngel.Relay.DelayedOn( Port5,1 );
ReefAngel.WaterLevelATO( Port6,225,44,46 );
ReefAngel.StandardHeater( Port7,255,265 );
ReefAngel.Relay.DelayedOn( Port8,1 );
ReefAngel.Relay.DelayedOn( Box1_Port4,1 );
////// Place your custom code below here
if (now%3600<600) {ReefAngel.PHControl(...);} else {
ReefAngel.Relay.Off(Port2);
}
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Irieivan" );
ReefAngel.ShowInterface();
}