Fans Ports

Do you have a question on how to do something.
Ask in here.
Post Reply
Bo0sted_Rafi
Posts: 75
Joined: Thu Mar 21, 2013 12:11 pm

Fans Ports

Post by Bo0sted_Rafi »

Im making some change from my other controller to RA and i need to know how i can code the fan port to work properly.

void loop()
{
ReefAngel.Relay.DelayedOn( Port2 );
ReefAngel.StandardLights( Port3,12,0,2,30 );
ReefAngel.StandardFan( Port4,788,780 );
ReefAngel.StandardLights( Port7,0,30,12,30 );
ReefAngel.CO2Control( Port8,660,645 );

I need the port turns on in 78.8* and stay on until the temp drops to 78.0, the problem its when its get on in 78.6 and oscilate to 78.8, its come off. The ramp in temp its very common and the fan comes on/off over 8-10 in 2 minutes. how i can code to get the port on until get the temp that i programed?
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Fans Ports

Post by lnevo »

The logic is backwards. It goes low temp first then high temp.

The high temp indicates at what time exceeded it will turn on. The low temp when it turns off.

Just switch your args i think you'll be fine.
Bo0sted_Rafi
Posts: 75
Joined: Thu Mar 21, 2013 12:11 pm

Re: Fans Ports

Post by Bo0sted_Rafi »

Ok just switch the code and its ok? Same in the ph port?
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Fans Ports

Post by lnevo »

Yeah looks that way..

void ReefAngelClass::CO2Control(byte CO2Relay, int LowPH, int HighPH)
{
if (Params.PH <= LowPH) Relay.Off(CO2Relay); // If PH <= LowPH - turn on CO2
if (Params.PH >= HighPH) Relay.On(CO2Relay); // If sensor 1 PH >= HighPH - turn off CO2
}
Bo0sted_Rafi
Posts: 75
Joined: Thu Mar 21, 2013 12:11 pm

Re: Fans Ports

Post by Bo0sted_Rafi »

i wich part of my code i need to put those specific code?
#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 <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.UseFlexiblePhCalibration();
    ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port7Bit ;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 830 );


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

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

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

void loop()
{
    ReefAngel.Relay.DelayedOn( Port2 );
    ReefAngel.StandardLights( Port3,12,0,2,30 );
    ReefAngel.StandardFan( Port4,780,788 );
    ReefAngel.StandardLights( Port7,0,30,12,30 );
    ReefAngel.CO2Control( Port8,645,660 );
    ////// Place your custom code below here
    ////// Place your custom code above here

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();
    // Water Level
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,54, "WL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,54, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();

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

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

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph( 5, 5 );
}
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Fans Ports

Post by lnevo »

No where..thats how the co2control function works...
Bo0sted_Rafi
Posts: 75
Joined: Thu Mar 21, 2013 12:11 pm

Re: Fans Ports

Post by Bo0sted_Rafi »

ok i will wait for my reactor turns off because today i get it on for about 1 week off. i let you know, thanks
Image
Post Reply