Help with Coding Multichannel Water Level Sensor and ATO

Expansion modules and attachments
Post Reply
Paul_Velasco
Posts: 127
Joined: Thu Sep 19, 2013 7:46 am
Location: Saint Cloud, FL

Help with Coding Multichannel Water Level Sensor and ATO

Post by Paul_Velasco »

Trying to set up my code to do ATO with the multichannel water level sensor
I am trying to turn the ATO pump on at 48% and off above 50%.

ATO = Sensor 4
Relay = Box1_Port7

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.Use2014Screen();  // Let's use 2014 Screen 
    ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
    ReefAngel.AddWaterLevelExpansion();  // Water Level Expansion Module
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit;
    ReefAngel.FeedingModePortsE[0] = Port1Bit | Port7Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port5Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port7Bit;
    // 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 = 0;
    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( 850 );

    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Port8 );
    ReefAngel.Relay.On( Box1_Port5 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port7,750,755 );
    ReefAngel.Relay.DelayedOn( Box1_Port1,10 );
    ReefAngel.StandardLights( Box1_Port3,20,0,8,0 );
    //ReefAngel.WaterLevelATO(4)(Box1_Port7,60,48,51 );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( Constant,30,10 );
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( Constant,50,10 );
    ReefAngel.DCPump.DaylightChannel = None;
    ReefAngel.DCPump.ActinicChannel = None;
    ReefAngel.DCPump.ExpansionChannel[0] = None;
    ReefAngel.DCPump.ExpansionChannel[1] = None;
    ReefAngel.DCPump.ExpansionChannel[2] = None;
    ReefAngel.DCPump.ExpansionChannel[3] = None;
    ReefAngel.DCPump.ExpansionChannel[4] = None;
    ReefAngel.DCPump.ExpansionChannel[5] = None;
    ////// Place your custom code below here
    
    if (ReefAngel.WaterLevel.GetLevel(4)<=48) ReefAngel.Relay.On(Box1_Port7);
    if (ReefAngel.WaterLevel.GetLevel(4)>=50) ReefAngel.Relay.Off(Box1_Port7);
    ////// Place your custom code above here

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

I get this error? Need to get this going I am on vacation next week.

Error:

sketch_mar16a.cpp: In function 'void loop()':
sketch_mar16a:103: error: 'class ReefAngelClass' has no member named 'WaterLevel'
sketch_mar16a:104: error: 'class ReefAngelClass' has no member named 'WaterLevel'

Oh yeah water levels to not show same on Portal and LCD Screen? I get 50 and 50 on LCD for Portal the numbers are way off???
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with Coding Multichannel Water Level Sensor and ATO

Post by rimai »

I'm compiling this code just fine.
Roberto.
Paul_Velasco
Posts: 127
Joined: Thu Sep 19, 2013 7:46 am
Location: Saint Cloud, FL

Re: Help with Coding Multichannel Water Level Sensor and ATO

Post by Paul_Velasco »

Just to close out this issue as it is fixed:

I had tried to look at the waterlevel.h and waterlevel.cpp files in notebook. Windows then associated the files to notebook. Ardunio did not recognize the files.

To fix I uninstalled Ardunio and the Reef Angel IDE Software
Reinstalled the software and compiled the code
Compiled and downloaded to controller :D

What IDE can I use to look at .h and .cpp files from the library so this does not happen? (IOS Windows 7)


I am still having issue with the portal. Will post in that forum.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with Coding Multichannel Water Level Sensor and ATO

Post by rimai »

You should be able to use notepad just fine.
I use eclipse for editing them.
I'm not sure why Arduino didn't recognize them but glad you got it working :)
Roberto.
Post Reply