Dimming module

Do you have a question on how to do something.
Ask in here.
Post Reply
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Dimming module

Post by bmhair03 »

How would I modify my code so the moonlight isn't so bright? Is it possible to turn dimmer port off ? So its only on at night?
I do currently have it coded for moon phase through the wizard. Moonlight is working but seems a little to bright for my liking .I know full moon is 3 days away but hoping there is a way.
Thanks.
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

#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>

////// 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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit;
// 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 );


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

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


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

void loop()
{
ReefAngel.StandardLights( Port2,7,20,19,30 );
ReefAngel.StandardLights( Port4,7,20,19,30 );
ReefAngel.StandardHeater( Port6,720,815 );
ReefAngel.SingleATO( true,Port8,10,0 );
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
ReefAngel.PWM.SetChannel( 0, MoonPhase() );
////// Place your custom code below here


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "bmhair03" );
ReefAngel.ShowInterface();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dimming module

Post by rimai »

You can multiply the moonphase by a certain amount.
So, if you want 50%, just use MoonPhase() * 0.5
Roberto.
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

Thank you for that. i got that dialed in and run the dimmer module power off a standard light outlet to give me the on/off control.
Is there a way to force the ATO to run for a set amount of time(like 3 sec) when needed "true"but also still have the time out of 10 sec. in place? My small tank seems to make the ATO run short burst like 1 secs but often all during the day.I believe the fact the sump is so small that the first rush of water is raising the float ,but i cant fit a tube around the sensor to buffer the float there is no more room.I already modified the last chamber of the BC14 to fit a mp10 dryside.
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

Here's my current 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 <Humidity.h>
#include <DCPump.h>
#include <PAR.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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port4Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit;
// 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 );


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

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


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

void loop()
{
ReefAngel.StandardLights( Port2,7,20,19,30 );
ReefAngel.StandardLights( Port3,19,0,6,0 );
ReefAngel.SingleATO( true,Port8,10,0 );
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
ReefAngel.PWM.SetChannel( 0, MoonPhase()*45 );
////// Place your custom code below here


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "bmhair03" );
ReefAngel.ShowInterface();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dimming module

Post by rimai »

Try this:

Code: Select all

ReefAngel.SingleATO( true,Port8,10,1 );
This should make it go only once an hour
Roberto.
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

Thank you
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

After .50 there seems to be no difference? I'm at .33 now .Moonlight stops working at .25 . Is it because I'm using a dimming module not a lunar module to control it?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dimming module

Post by rimai »

It may not like the floating point.
Try division then.
MoonPhase()/4 is basically the same a *0.25
Roberto.
bmhair03
Posts: 166
Joined: Sun Mar 20, 2011 1:22 pm

Re: Dimming module

Post by bmhair03 »

Thank you I had forgotten to put the 0 in. rebooted it and its working great.
Thank once again. My sloppy coding always gets me.!
Post Reply