did what you suggested and got the same result.
Here's the PDE.
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 <ReefAngel.h>
#define AutoTopOff 1
#define Skimmer 2
#define Port3 3
#define Heater 4
#define WM1 5
#define WM2 6
#define SeaSwirl 7
#define Return 8
/*
Ports assignment:
Port1 - Standard ATO - "http://forum.reefangel.com/viewtopic.php?f=7&t=240"
Port2 - Skimmer
Port3 - Port3
Port4 - Heater - "http://www.reefangel.com/Support.Relay-function-StandardHeater.ashx"
Port5 - Wavemaker 1
Port6 - Wavemaker 2 - "http://www.reefangel.com/Support.Activating-a-relay.ashx"
Port7 - SeaSwirl
Port8 - Return
*/
#define PWMRB1 0
#define PWMRB2 1
#define PWMRB3 2
#define PWMWT1 3
#define PWMWT2 4
#define PWMHN 5
byte PWMChannel[]={
0,0,0,0,0,0};
void setup()
{
ReefAngel.Init();
ReefAngel.FeedingModePorts = Port2Bit | Port5Bit | Port6Bit | Port8Bit; // Turn off Port6 and Port8 when feeding mode is activated
ReefAngel.WaterChangePorts = Port2Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Port5, Port6, Port7 and Port8 when water change mode is activated
ReefAngel.Relay.DelayedOn(Skimmer,2); // Turn on Port 7
ReefAngel.Relay.On(SeaSwirl); // Turn on Port 7
ReefAngel.Relay.On(Return); // Turn on Port 8
}
void loop()
{
ReefAngel.StandardATO(AutoTopOff, 60); // ATO with 60 seconds timeout
ReefAngel.StandardHeater(Heater,788,792); // Heater on at 77.0F and off at 78.0F
ReefAngel.WavemakerRandom(WM2,15,60); // Turn Port5 on/off random cycles that lasts from 15 to 60 secs
ReefAngel.ShowInterface();
if (hour()>=21 || hour()<10)
{
ReefAngel.PWM.SetActinic(MoonPhase());
}
else
{
ReefAngel.PWM.SetActinic(0);
}
//************************************************************ Start of PWM Expansion Code for Slope
PWMChannel[PWMRB2]=PWMSlope(9,30,21,20,0,95,60,PWMChannel[PWMRB2]); //Royal Blue - Left Bank
PWMChannel[PWMRB3]=PWMSlope(9,50,21,40,0,95,60,PWMChannel[PWMRB3]); //Royal Blue - Middle Bank
PWMChannel[PWMRB1]=PWMSlope(10,10,22,00,0,95,60,PWMChannel[PWMRB1]); //Royal Blue - Right Bank
PWMChannel[PWMWT2]=PWMSlope(11,00,21,00,0,95,80,PWMChannel[PWMWT2]); //XP-E Cool Whites - Left Side
PWMChannel[PWMWT1]=PWMSlope(11,10,21,30,0,95,80,PWMChannel[PWMWT1]); //XP-E Cool Whites - Right Side
PWMChannel[PWMHN]=PWMSlope(12,00,20,00,0,95,120,PWMChannel[PWMHN]); //XP-G Cool Whites - Left Side
if (hour()>=21 || hour()<12)
{
ReefAngel.PWM.SetDaylight(0);
}
else
{
ReefAngel.PWM.SetDaylight(PWMSlope(12,00,20,30,0,95,120,ReefAngel.PWM.GetDaylightValue())); //XP-G Cool Whites - Right Side
}
for (int a=0;a<6;a++)
{
ReefAngel.PWM.Expansion(a,int(2.55*PWMChannel[a]));
}
//************************************************************* End of PWM Expansion Code for Slope
}