lnevo wrote:Your error is coming from somewhere else. It's a syntax error. Whats the tide code your trying to add? Post your before and after code in full.
Yeah, it is a compile or type-o on my part for sure. I removed it and added a if statement to slow them down after lights out. That appeared to work ok. At this point and time it is more of a learning / reading threads to understand how the libraries work that I want to use. I see the tidal simulation and also found the weather pattern based on location. Both of which sound super cool but not sure how to implement
Also am trying to understand what the various power head modes do. I have reef crest implemented now and saw a graph somewhere, not sure where now, but it looked cool. Not sure how the sync anti-sync work though. My original post was to make them alternate so they don't always go the same direction - thus tide/high/low. Does the library automatically sync-anti-sync or change directions based on a set time?
Anyway - they are working now and slow down at night. That was the first hurdle. Now it is just playing and learning. Like why Daylight is 41% vs. Actinic at 69% (they change all the time) but I have power set to 55%? Even if it is plus 10, I am over and seen it higher.
Thanks - searching and reading
Good stuff and love the additions.
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>
#include <Tide.h> // testing for tide control
////// Place global variable code below here
Tide tide; // testing for tide control
////// 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.AddPHExpansion(); // pH Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
// Ports that are always on
ReefAngel.Relay.On( Port1 ); // skimmer
// ReefAngel.Relay.On( Port4 ); // LED Fans
ReefAngel.Relay.On( Port5 ); // RW 4 left side facing tank
ReefAngel.Relay.On( Port6 ); // RW 4 right side facing tank
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port2,9,0,21,0 ); // power to LED power supply
ReefAngel.StandardLights( Port4,9,0,21,0 ); // LED fans
// ReefAngel.WavemakerRandom( Port5,5,90 ); // Not sure what these are for now
// ReefAngel.WavemakerRandom( Port6,5,90 ); // Not sure what these are for now
// ReefAngel.StandardLights( Port7,9,0,21,0 );
// ReefAngel.StandardLights( Port8,9,0,21,0 );
// Channel 0 (1000mA max) - 5 Neutral White
// Channel 1 (1000mA max) - 6 Royal Blue + 5 Blue
// Channel 2 (700mA max) - 12 Lime
// Channel 3 (700mA max) - 5 Violet UV + 4 Deep Red (660nm)
ReefAngel.PWM.SetChannel( 0, PWMParabola(10,0,21,0,0,65,0) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(10,0,21,0,0,75,0) );
ReefAngel.PWM.SetChannel( 2, PWMParabola(10,0,21,0,0,65,0) );
ReefAngel.PWM.SetChannel( 3, PWMParabola(10,0,21,0,0,65,0) );
ReefAngel.DCPump.UseMemory = false;
// ReefAngel.DCPump.SetMode( ReefCrest,55,10 );
ReefAngel.DCPump.DaylightChannel = Sync;
ReefAngel.DCPump.ActinicChannel = AntiSync;
// 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 (hour()>=21 || hour()<10)
{
// Sleep mode - slow things down
ReefAngel.DCPump.SetMode( ReefCrest,25,10 );
}
else
{
// Normal power
ReefAngel.DCPump.SetMode( ReefCrest,55,10 );
}
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "saf1" );
ReefAngel.DDNS( "saf1-dns.myreefangel.com" ); // Your DDNS is saf1-saf1-dns.myreefangel.com.myreefangel.com
ReefAngel.ShowInterface();
}