Need help with an error code

Do you have a question on how to do something.
Ask in here.
Post Reply
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Need help with an error code

Post by dangrymidget »

I've been reading through the forums figuring out my code, when i tried to upload it I got a " no matching function for call to 'ReefAngelClass::SingleATOLow(int, int)'"

here's my code:

Code: Select all

void setup()
{
  ReefAngel.Init(); //Initialize controller
  ReefAngel.Relay.On(Port8); //Turn Port8 on at startup
  ReefAngel.PWM.SetDaylight(0);  //Set pwm daylight channel to 0%
}
 
void loop()
{
  ReefAngel.SingleATOLow(Port1,60);  //Setup Port1 as Auto Top-Off function with on/off
      if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1); //upper float set as shut off fail safe
  ReefAngel.StandardLights(Port2,22,30,8,0);  //Moonlight schedule 10:30pm - 8:00am
  ReefAngel.StandardLights(Port3,20,00,10,00);  //Refugium schedule 8:00pm - 10:00am
  ReefAngel.StandardHeater(Port6,780,785);  // Setup Heater to turn on at 78.0F and off at 78.5F
  ReefAngel.StandardFan(Port7,790,785);  // Setup Chiller to turn on at 79.0F and off at 78.5F
  ReefAngel.ShowInterface(); // Draws the standard graphical user interface}
  ReefAngel.PWM.SetDaylight(PWMSlope(9,30,21,30,0,25,60,0) //lights on at 9:00am off at 9:00pm from 0% to 100% over 120 min
}
Would appreciate it if someone could tell me what my problem is. I also want to know if i have my first light coded right, I want it to power on at 9:00 at 0% and start the dimming cycle at 9:30
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Need help with an error code

Post by binder »

The error is because you are trying to do too much with the SingleATOLow function. You are trying to give it a timeout value and it does not need one. It uses the timeout value that is in the Internal Memory. So, you need to change your function to this:

Code: Select all

ReefAngel.SingleATOLow(Port1);
As for your second question, if you are referring to the PWM slope function, then you are off a little. You are missing some stuff to make it work properly.
Use this instead:

Code: Select all

void setup()
{
  ReefAngel.Init(); //Initialize controller
  ReefAngel.Relay.On(Port8); //Turn Port8 on at startup
  ReefAngel.PWM.SetDaylight(0);  //Set pwm daylight channel to 0%
}

void loop()
{
  ReefAngel.SingleATOLow(Port1);  //Setup Port1 as Auto Top-Off function with on/off
  if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1); //upper float set as shut off fail safe
  ReefAngel.StandardLights(Port2,22,30,8,0);  //Moonlight schedule 10:30pm - 8:00am
  ReefAngel.StandardLights(Port3,20,0,10,0);  //Refugium schedule 8:00pm - 10:00am
  ReefAngel.StandardHeater(Port6,780,785);  // Setup Heater to turn on at 78.0F and off at 78.5F
  ReefAngel.StandardFan(Port7,790,785);  // Setup Chiller to turn on at 79.0F and off at 78.5F

  ReefAngel.PWM.SetDaylight(PWMSlope(9,0,21,0,0,100,120,0)); //lights on at 9:00am off at 9:00pm from 0% to 100% over 120 min

  ReefAngel.ShowInterface(); // Draws the standard graphical user interface
}
That will set your PWM function to match what you put in the comment about it.
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

Awesome thanks for the help!
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

I'm also trying to set my Moonlights on a 28 day cycle, but i have no idea where to start. can you point me in the right direction.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Need help with an error code

Post by binder »

dangrymidget wrote:I'm also trying to set my Moonlights on a 28 day cycle, but i have no idea where to start. can you point me in the right direction.
Sure can. Start here and read through this...

http://forum.reefangel.com/viewtopic.ph ... tPWM#p1099

You can also start searching on here for Moonlight, Moonphase, or Moonlightpwm
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with an error code

Post by rimai »

Use this on your loop:

Code: Select all

ReefAngel.PWM.SetActinic(MoonPhase());
Roberto.
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

I read through the forum you linked and have a few questions: i'm not sure where to put the byte MoonPhase() code, when i put in i keep getting already defined errors. the other problem i'm having is with the PWM module, i want to hook my 2 moonlights up but i'm getting a not declared error. here's my code so far

Code: Select all

#include <Salinity.h>
#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>
void setup()
{
  ReefAngel.Init(); //Initialize controller
  ReefAngel.Relay.On(Port8); //Turn Port8 on at startup
  ReefAngel.PWM.SetDaylight(0);  //Set pwm daylight channel to 0%
  
}
 
void loop()
{
  ReefAngel.SingleATOLow(Port1);  //Setup Port1 as Auto Top-Off function with on/off
      if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1); //upper float set as shut off fail safe
  ReefAngel.StandardLights(Port3,20,00,10,00);  //Refugium schedule 8:00pm - 10:00am
  ReefAngel.StandardHeater(Port6,780,785);  // Setup Heater to turn on at 78.0F and off at 78.5F
  ReefAngel.StandardFan(Port7,790,785);  // Setup Chiller to turn on at 79.0F and off at 78.5F
  ReefAngel.PWM.SetActinic(PWMSlope(9,30,21,30,0,25,60,0)); //lights on at 9:30am off at 9:30pm from 0% to 25% over 60 min
  ReefAngel.PWM.SetDaylight(PWMSlope(9,30,21,30,0,25,60,0)); //lights on at 9:30am off at 9:30pm from 0% to 25% over 60 min  
  PWMChannel[LEDPWM1]=MoonPhase();
  PWMChannel[LEDPWM2]=MoonPhase();
  ReefAngel.ShowInterface(); // Draws the standard graphical user interface
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with an error code

Post by rimai »

Let me just understand what you have.
You have an led driver connected to actinic PWM port and one driver connected to daylight PWM port, correct?
Then, you also have the PWM expansion module, right?
And you are trying to connect 2 dimmable moonlights on channels 0 and 1 of the PWM expansion module, is that correct?
Roberto.
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

You have an led driver connected to actinic PWM port and one driver connected to daylight PWM port, correct?
Then, you also have the PWM expansion module, right?
And you are trying to connect 2 dimmable moonlights on channels 0 and 1 of the PWM expansion module, is that correct?
yes, i have the eagle files for the module but again not sure where to put them
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with an error code

Post by rimai »

Use this then:

Code: Select all

#include <Salinity.h>
#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>
void setup()
{
  ReefAngel.Init(); //Initialize controller
  ReefAngel.Relay.On(Port8); //Turn Port8 on at startup
  ReefAngel.PWM.SetDaylight(0);  //Set pwm daylight channel to 0%

}

void loop()
{
  ReefAngel.SingleATOLow(Port1);  //Setup Port1 as Auto Top-Off function with on/off
  if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1); //upper float set as shut off fail safe
  ReefAngel.StandardLights(Port3,20,00,10,00);  //Refugium schedule 8:00pm - 10:00am
  ReefAngel.StandardHeater(Port6,780,785);  // Setup Heater to turn on at 78.0F and off at 78.5F
  ReefAngel.StandardFan(Port7,790,785);  // Setup Chiller to turn on at 79.0F and off at 78.5F
  ReefAngel.PWM.SetActinic(PWMSlope(9,30,21,30,0,25,60,0)); //lights on at 9:30am off at 9:30pm from 0% to 25% over 60 min
  ReefAngel.PWM.SetDaylight(PWMSlope(9,30,21,30,0,25,60,0)); //lights on at 9:30am off at 9:30pm from 0% to 25% over 60 min  
  ReefAngel.PWM.SetChannel(0,MoonPhase());
  ReefAngel.PWM.SetChannel(1,MoonPhase());
  ReefAngel.ShowInterface(); // Draws the standard graphical user interface
}

Then, you will connect the dimmable moonlights to channel 0 and 1.
Roberto.
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

I'm getting a code to big error with this code, how do i shrink it? at 32562 of 322256 bytes
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with an error code

Post by rimai »

Try using the simple menu
Roberto.
dangrymidget
Posts: 25
Joined: Thu Mar 01, 2012 8:17 pm

Re: Need help with an error code

Post by dangrymidget »

Awesome, got it working. Thanks for the help!
Post Reply