pH control linked to water level and timed safety

Do you have a question on how to do something.
Ask in here.

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: 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?

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Mon Sep 11, 2017 3:09 pm
Yeap
Roberto.

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: Mon Sep 11, 2017 3:26 pm
Thank you
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Sep 11, 2017 4:37 pm
Take out or comment the line that has the original PHControl statement so you dont get confused later :) You can comment it with a // in front.

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: Tue Sep 12, 2017 11:00 am
Like I keep saying, I am too stupid for this.

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();
}


And when I try to upload, I get an error:

invalid operands of type time_t00'and'init' to binary'operator%'

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: Tue Sep 12, 2017 11:29 am
When I replace the (...) in the suggested code with my pH control values, I get the same error

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Sep 12, 2017 12:09 pm
I think there is a typo.
It should be now() and not just now
Roberto.

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: Tue Sep 12, 2017 1:05 pm
if (now(%3600<600) {
ReefAngel.PHControl(Port2,819,822);
} else {
ReefAngel.Relay.Off(Port2);
}

Error again:

Expected primary expression before'%' token

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Sep 12, 2017 1:10 pm
It's now() and not now(
Roberto.

Posts: 51
Joined: Sun Aug 20, 2017 6:19 am
PostPosted: Tue Sep 12, 2017 1:11 pm
Ok got it figured out thanks
Previous

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 4 guests