First off, let me tell you that I finally got this thing working correctly on my 55 when I decided to do an upgrade to a 120. I am using the iPhone app which at this point is the only way I can control most of the tank (manually). I thought I was figuring this thing out but now I'm as lost as the day I bought it. At this point, here is what I want it to do:
Relay 1: ATO I have it on low so because I am using an aqualifter
Relay 2: Skimmer (off during feeding)
Relay 3: Lights (not ready to get creative with them yet!)
Relay 4: Pump (I might just move this to a constant 110v)
Relay 5: Wavemaker (I am using an eternal controller but want it turned off during water changes and feeding)
Relay 6: Standard heater (on 79.1; off 80)
Relay 7: Dose pump (one second twice a day, off during feeding and water change)
Relay 8: Dose pump (one second twice a day, off during feeding and water change)
I will need to modify this eventually so if all notes would be appreciated! Here are my codes>
Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>
RA_NokiaLCD e;
void setup()
{
e.Init();
e.Clear(COLOR_WHITE,0,0,132,132);
e.BacklightOn();
InternalMemory.MHOnHour_write(0);
InternalMemory.MHOnMinute_write(0);
InternalMemory.MHOffHour_write(0);
InternalMemory.MHOffMinute_write(0);
InternalMemory.MHDelay_write(0);
InternalMemory.StdLightsOnHour_write(15);
InternalMemory.StdLightsOnMinute_write(30);
InternalMemory.StdLightsOffHour_write(20);
InternalMemory.StdLightsOffMinute_write(30);
InternalMemory.DP1OnHour_write(20);
InternalMemory.DP1OnMinute_write(0);
InternalMemory.DP2OnHour_write(22);
InternalMemory.DP2OnMinute_write(30);
InternalMemory.DP1Timer_write(4);
InternalMemory.DP2Timer_write(4);
InternalMemory.DP1RepeatInterval_write(60);
InternalMemory.DP2RepeatInterval_write(60);
InternalMemory.ATOTimeout_write(255);
InternalMemory.ATOHighTimeout_write(60);
InternalMemory.ATOHourInterval_write(0);
InternalMemory.ATOHighHourInterval_write(0);
InternalMemory.FeedingTimer_write(900);
InternalMemory.LCDTimer_write(600);
InternalMemory.LEDPWMActinic_write(100);
InternalMemory.LEDPWMDaylight_write(100);
InternalMemory.WM1Timer_write(0);
InternalMemory.WM2Timer_write(0);
InternalMemory.HeaterTempOn_write(791);
InternalMemory.HeaterTempOff_write(800);
InternalMemory.ChillerTempOn_write(774);
InternalMemory.ChillerTempOff_write(770);
InternalMemory.OverheatTemp_write(1500);
InternalMemory.PHMax_write(830);
InternalMemory.PHMin_write(540);
InternalMemory.SalMax_write(2550);
InternalMemory.RFMode_write(Constant);
InternalMemory.RFSpeed_write(140);
InternalMemory.RFDuration_write(8);
InternalMemory.RFDuration_write(8);
InternalMemory.PWMSlopeStartD_write(15);
InternalMemory.PWMSlopeEndD_write(100);
InternalMemory.PWMSlopeDurationD_write(60);
InternalMemory.PWMSlopeStartA_write(15);
InternalMemory.PWMSlopeEndA_write(100);
InternalMemory.PWMSlopeDurationA_write(60);
InternalMemory.IMCheck_write(0x5241494D);
}
void loop()
{
// display the values
char buf[128];
sprintf(buf, "MH %2d:%02d-%2d:%02d,%d", InternalMemory.MHOnHour_read(), InternalMemory.MHOnMinute_read(),
InternalMemory.MHOffHour_read(), InternalMemory.MHOffMinute_read(),
InternalMemory.MHDelay_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
sprintf(buf, "Std %2d:%02d-%2d:%02d", InternalMemory.StdLightsOnHour_read(), InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(), InternalMemory.StdLightsOffMinute_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
sprintf(buf, "LED A: %d%% D: %d%%", InternalMemory.LEDPWMActinic_read(), InternalMemory.LEDPWMDaylight_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
sprintf(buf, "WM1: %ds", InternalMemory.WM1Timer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, buf);
sprintf(buf, "WM2: %ds", InternalMemory.WM2Timer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, "F: %ds", InternalMemory.FeedingTimer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "S: %ds", InternalMemory.LCDTimer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
sprintf(buf, "H On: %d -> %d", InternalMemory.HeaterTempOn_read(), InternalMemory.HeaterTempOff_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*9, buf);
sprintf(buf, "C On: %d -> %d", InternalMemory.ChillerTempOn_read(), InternalMemory.ChillerTempOff_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*10, buf);
sprintf(buf, "PH %d - %d", InternalMemory.PHMax_read(), InternalMemory.PHMin_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*11, buf);
delay(10000);
e.Clear(COLOR_WHITE,0,0,132,132);
sprintf(buf, "OH: %dF", InternalMemory.OverheatTemp_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
sprintf(buf, "ATO L: %ds (%dh)", InternalMemory.ATOTimeout_read(), InternalMemory.ATOHourInterval_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
sprintf(buf, "ATO H: %ds (%dh)", InternalMemory.ATOHighTimeout_read(), InternalMemory.ATOHighHourInterval_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
sprintf(buf, "DP1: %2d:%02d", InternalMemory.DP1OnHour_read(), InternalMemory.DP1OnMinute_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, " %ds", InternalMemory.DP1Timer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "DP2: %2d:%02d", InternalMemory.DP2OnHour_read(), InternalMemory.DP2OnMinute_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
sprintf(buf, " %ds", InternalMemory.DP2Timer_read());
e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*8, buf);
delay(10000);
e.Clear(COLOR_WHITE,0,0,132,132);
}
[code]
and
[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 <ReefAngel.h>
void setup()
{// Starting from the left, it's Ports 87654321;
ReefAngel.FeedingModePorts = B01001011;
ReefAngel.WaterChangePorts = B10110011;
ReefAngel.Init(); //Initialize controller
}
void loop()
{
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port3);
ReefAngel.Wavemaker1(Port5);
ReefAngel.StandardHeater(Port6);
if (now()%43200<1) ReefAngel.Relay.On(Port7);
else ReefAngel.Relay.Off(Port7);
if (now()%43200<1) ReefAngel.Relay.On(Port8);
else ReefAngel.Relay.Off(Port8);
// You can only increment the dosing in seconds
// 43200 the frequency in seconds that the dosing pump will be activated. 24hrs= 86400s, 12hrs= 43200s
// 1 is the number of seconds that the dosing pump will stay on.
ReefAngel.Portal("mineman@mac.com");
ReefAngel.ShowInterface();
}
[code]