How to set up lights

Do you have a question on how to do something.
Ask in here.
Post Reply
rschneider77
Posts: 54
Joined: Mon Oct 24, 2011 10:16 am
Location: Gainesville, Florida

How to set up lights

Post by rschneider77 »

First, I am a newbie, never have worked with open source or coding before.elo
I am using the the Developement libraries, latest version.

I have assigned my ports for the lights.
I have one light fixture that consists of T5 lights (4 bulbs) and moon lights (LED) - 3 electrical plugs.
I want the led moon lights to come on at 7:00am and go off at 8:00pm.
Have one white and one actinic to come on at 7:30am and go off at 5:30pm.
Have one white and one actinic to come on at 9:30am and go off at 7:30pm.
This is the way I have my bulbs set to the electrical plugs.

I know coding is involved now. What do I do next?

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (01/08/2012 12:39)
// RA_010812_1239.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.StandardLights(Port3);
    ReefAngel.StandardLights(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);

	ReefAngel.ShowInterface();
}
Bob
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: How to set up lights

Post by binder »

With what you said, you will only need slight modifications.

1. You need to have uploaded the InternalMemory PDE with the times set in them.
2. You will want to use StandardLights for one plug and MetalHalides for another. Even though it says MetalHalides, it's just referencing a different storage location for the on / off times.
3. If you want the 3rd plug to be able to be changed via the InternalMemory (from web app, or android/iphone app), you will need to add in some additional functions. If you do not plan on changing the times, you can hard code the times.

So you can do this:

Code: Select all

ReefAngel.StandardLights(Port2);
ReefAngel.MetalHalides(Port3);
ReefAngel.StandardLights(Port4, 7, 0, 20, 0);
The long form is in the form of StandardLights(PORT, on hour, on minute, off hour, off minute)
I also coded the last one to be the time for your moonlights. If you want to use InternalMemory instead, we can do that. This should get you going first though.
rschneider77
Posts: 54
Joined: Mon Oct 24, 2011 10:16 am
Location: Gainesville, Florida

Re: How to set up lights

Post by rschneider77 »

Curt,

Thank you for the reply. Everything is working, except for the ATO, but I am working on it.

There is one other issue with the lights. I have the led moon lights come on at 6:30am and go off at 8:30pm. What I want to happen is have the led moon lights come on at 6:30am go off at 8:30am and then come back on at 6:30pm and go back off at 8:30pm.

Bob
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: How to set up lights

Post by binder »

You can just duplicate the StandardLights line for your moon lights and change the times to be the ones you want. So you can do this:

Code: Select all

ReefAngel.StandardLights(Port3, 6, 30, 8, 30);  // 6:30a - 8:30a
ReefAngel.StandardLights(Port3, 18, 30, 20, 30); // 6:30p - 8:30p
This will control Port3 to run from 6:30a to 8:30a and then 6:30p to 8:30p. You will just need to change Port3 to whatever port you have your moon lights plugged into.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to set up lights

Post by rimai »

Actually, I think you need a simple check too:

Code: Select all

if (hour()<12)
  ReefAngel.StandardLights(Port3, 6, 30, 8, 30);  // 6:30a - 8:30a
else
  ReefAngel.StandardLights(Port3, 18, 30, 20, 30); // 6:30p - 8:30p
Roberto.
Post Reply