Sunrise/set by a location?
Sunrise/set by a location?
So this is going to be my first alteration of my code outside of generating a code through the wizard, so pardon my need to be spoken to like i am 5 years old in advance.
I know Inevo has it in his code but I don't know what i need to copy over and where i need to put it. I would like it to be set to somewhere in the Caribbean since it would be in or close to my time zone.
I am hoping this is a good place to start with customizing, but if this will be too much to start with please let me know.
Thank you in advance
I know Inevo has it in his code but I don't know what i need to copy over and where i need to put it. I would like it to be set to somewhere in the Caribbean since it would be in or close to my time zone.
I am hoping this is a good place to start with customizing, but if this will be too much to start with please let me know.
Thank you in advance
Re: Sunrise/set by a location?
Its in the libraries now. What did you want to customize?
Re: Sunrise/set by a location?
My use of the word customize is changing the code outside of the wizard.lnevo wrote:Its in the libraries now. What did you want to customize?
Is the library set to a certain location? Can the location be changed?
What would I need to add and where do I add it?
Re: Sunrise/set by a location?
Ahh, ok. No, the SunLocation class does not deal directly with memory you would have to do that part on your own. You'd then need to use the web api or "custom memory locations" support that some apps have.
Here's some of the code you can find in my INO that will define the custom memory locations and set them.
#define Mem_I_Latitude 108
#define Mem_I_Longitude 110
SunLocation sun;
sun.Init(InternalMemory.read_int(Mem_I_Latitude), InternalMemory.read_int(Mem_I_Longitude));
The SunLocation class should update the std memory locations for lights, so any of the StandardLights or PWM code that relies on memory should use the times now that are calculated.
Here's some of the code you can find in my INO that will define the custom memory locations and set them.
#define Mem_I_Latitude 108
#define Mem_I_Longitude 110
SunLocation sun;
sun.Init(InternalMemory.read_int(Mem_I_Latitude), InternalMemory.read_int(Mem_I_Longitude));
The SunLocation class should update the std memory locations for lights, so any of the StandardLights or PWM code that relies on memory should use the times now that are calculated.
Re: Sunrise/set by a location?
You will have to excuse my ignorance here, but i am still new to the RA and trying to learn how to make the most of it.lnevo wrote:Ahh, ok. No, the SunLocation class does not deal directly with memory you would have to do that part on your own. You'd then need to use the web api or "custom memory locations" support that some apps have.
Here's some of the code you can find in my INO that will define the custom memory locations and set them.
#define Mem_I_Latitude 108
#define Mem_I_Longitude 110
SunLocation sun;
sun.Init(InternalMemory.read_int(Mem_I_Latitude), InternalMemory.read_int(Mem_I_Longitude));
The SunLocation class should update the std memory locations for lights, so any of the StandardLights or PWM code that relies on memory should use the times now that are calculated.
So to utilize the sunlocation, i would have to have the code loaded into the Internal Memory? Which I need wifi adapter to change anything, correct? Is this able to be done with the standard dimming ports or is the dimming module required for it? I really appreciate the help.
Re: Sunrise/set by a location?
No you don't need to use the internal memory but if you want to be able to change it on the fly you do and if you want to change it without reloading code then you need the wifi module.
It's not made to use any specific ports. By default it sets the memory location for StandardLights and the StandardPWM functions based on the GPS code you set. You can also grab the rise hour / minute and set hour/minute and use them however you want if it's not lights you want to control.
It's not made to use any specific ports. By default it sets the memory location for StandardLights and the StandardPWM functions based on the GPS code you set. You can also grab the rise hour / minute and set hour/minute and use them however you want if it's not lights you want to control.
Re: Sunrise/set by a location?
So i would need to add
with the other #include lines?
I would add
under
?
If this is correct, then this is where I am stuck.
Not using Internal memory, I know the lines
would be different, assuming I need the lines.
Not sure where
needs to go, and how to change it out of Internal Memory.
Here is my code as it is now.
I am planning on getting the wifi module within the next week or so. Would it be better if i created a code with the internal memory now and upload it once i get the wifi?
Code: Select all
#include <SunLocation.h>
I would add
Code: Select all
SunLocation sun;
Code: Select all
////// Place global variable code below here
If this is correct, then this is where I am stuck.
Not using Internal memory, I know the lines
Code: Select all
#define Mem_I_Latitude 108
#define Mem_I_Longitude 110
Not sure where
Code: Select all
sun.Init(InternalMemory.read_int(Mem_I_Latitude), InternalMemory.read_int(Mem_I_Longitude));
Here is my code as it is now.
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>
////// 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.AddStandardMenu(); // Add Standard Menu
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port4Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// 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( 810 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port4 );
ReefAngel.Relay.On( Port6 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardHeater( Port2,778,788 );
ReefAngel.StandardHeater( Port3,761,771 );
ReefAngel.SingleATO( true,Port5,60,0 );
ReefAngel.StandardLights( Port7,19,0,11,0 );
ReefAngel.StandardLights( Box1_Port1,9,0,19,0 );
ReefAngel.Relay.Set( Box1_Port2, !ReefAngel.Relay.Status( Box1_Port1 ) );
ReefAngel.PWM.SetDaylight( PWMParabola(9,30,20,30,0,100,0) );
ReefAngel.PWM.SetActinic( PWMParabola(9,0,21,0,0,100,0) );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
Re: Sunrise/set by a location?
without internal memory just put this in your setup function..
sun.Init(whatever_lattitude, whatever_longitude);
If your gonna do it with memory then the code should go in loop() so it can be read if it changes.
Also keep in mind the times are wonky because the RA does not take timezone into account. So whatever time your RA is set for it thinks is UTC. So whatever timezone your in you need to adjust for that, either by setting the offset or by adjusting your longitude(?) Either way play around with it till it's near the schedule you want.
sun.Init(whatever_lattitude, whatever_longitude);
If your gonna do it with memory then the code should go in loop() so it can be read if it changes.
Also keep in mind the times are wonky because the RA does not take timezone into account. So whatever time your RA is set for it thinks is UTC. So whatever timezone your in you need to adjust for that, either by setting the offset or by adjusting your longitude(?) Either way play around with it till it's near the schedule you want.
Re: Sunrise/set by a location?
Thank you for the info. I will let you know how it goes.