Custom moon schedule (sunrise/sunset)

Do you have a question on how to do something.
Ask in here.
Post Reply
jabregousmc
Posts: 4
Joined: Mon Dec 10, 2012 2:15 pm
Location: North Carolina

Custom moon schedule (sunrise/sunset)

Post by jabregousmc »

Hey guys. I have a Coralife Lunar Aqualight with 2 led moon lights. What I'm wanting to do is have the leds come on say an hour before my "actinics" then turn off and come back on for say a few hours after my actinics go off.

Something like:
9am - 10am moon lights
10am - 8pm actinics
11am - 7pm day lights
8pm - 12:00am moon lights

I already have my normal light schedule set up so that the moon lights come on after my main lights go out but would like to have them on before and after main lights. Here is my current code:

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 <ReefAngel.h>

void setup()
{
  ReefAngel.Init(); // Initialize Controller
  ReefAngel.AddStandardMenu();
  ReefAngel.AddDateTimeMenu();  
  ReefAngel.FeedingModePorts = Port1Bit | Port5Bit; // Turn off Ports 1 and 5 when Feeding Mode is activated
  ReefAngel.WaterChangePorts = Port1Bit | Port5Bit; // Turn off Ports 1, 5 when Water Change Mode is activated
  ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit | Port6Bit | Port7Bit; // Turn off Ports 3, 4, 6 and 7 when overheat occurs
  ReefAngel.LightsOnPorts = Port3Bit | Port4Bit; // Turn on/off Ports 3 and 4 when Light On/Off menu option is selected
  ReefAngel.OverheatProbe = T1_PROBE; // Use Temperature probe 1 to check for overheat
  
  //These ports are always on
  ReefAngel.Relay.On(Port1);
  ReefAngel.Relay.On(Port5);
  ReefAngel.Relay.On(Port8);
}

void loop()
{
  ReefAngel.LCD.DrawLargeText(COLOR_STEELBLUE,COLOR_WHITE,28,121,"Joe's Reef"); // Display Reef Angel banner
  ReefAngel.StandardLights(Port2,20,0,1,0); // Moonlights
  ReefAngel.StandardLights(Port3,60); // Actinic Lights
  ReefAngel.StandardLights(Port4); // Daylight Lights
  ReefAngel.StandardHeater(Port6,780,790); // Heater
  ReefAngel.StandardLights(Port7,0,0,6,0); // Refugium Light
  ReefAngel.ShowInterface(); // Display everything on the LCD screen
  ReefAngel.Portal("jabregousmc"); 
}
Any suggestions would be great. Thanks in advance.



Joe
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom moon schedule (sunrise/sunset)

Post by rimai »

Replace this:

Code: Select all

  ReefAngel.StandardLights(Port2,20,0,1,0); // Moonlights
With this:

Code: Select all

  if (hour()<12)
    ReefAngel.StandardLights(Port2,9,0,10,0); // Moonlights from 9am to 10am
  else
    ReefAngel.StandardLights(Port2,20,0,0,0); // Moonlights from 8pm to 12am
Roberto.
jabregousmc
Posts: 4
Joined: Mon Dec 10, 2012 2:15 pm
Location: North Carolina

Re: Custom moon schedule (sunrise/sunset)

Post by jabregousmc »

Thanks for the reply. Updated it now.
Post Reply