i am really happy with my controller!
but i was thinking how cool would be have the control of the Ecotech Radion or Vortech in the app.
cheers!
erick
Yes, the iPhone does have a custom memory field. So you can use those locations.rimai wrote:I think the iPhone has a custom memory field that you can use.
The memory locations are:
Mode - 855
Speed - 856
Duration - 857
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 <ReefAngel.h>
//#define Constant 0
//#define Random1 1 // Lagoonal
//#define Random2 2 // Reef Crest
//#define ShortWave 3
//#define LongWave 4
//#define Smart_NTM 5 // Nutrient Transport Mode
//#define Smart_TSM 6 // Tidal Swell Mode
//#define Feeding_Start 7
//#define Feeding_Stop 8
//#define Night 9
//#define Slave_Start 97
//#define Slave_Stop 98
//#define None 99
void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.LCD.DrawText(0,255,20,50,"Assigning Slaves");
ReefAngel.RF.SetMode(Slave_Start,0,0);
/*
If you get a compile error similar to this:
'class ReefAngelClass' has no member named 'RF'
Please make sure that you enabled RF Expansion on your features file.
Open RAGen and make sure you have RF Expansion checked under the Features tab.
Or, you can manually edit the file.
The file is located at "Documents\Arduino\libraries\ReefAngel_Features.h" file and has to include this line in it:
#define RFEXPANSION
*/
InternalMemory.RFMode_write(855);
InternalMemory.RFSpeed_write(856);
InternalMemory.RFDuration_write(857);
}
void loop()
{
ReefAngel.Refresh();
if (ReefAngel.Joystick.IsButtonPressed())
{
ReefAngel.RF.SetMode(Slave_Stop,0,0);
ReefAngel.LCD.DrawText(0,255,50,60,"Done");
}
}pilonstar wrote:thanks guys but i trying and the app keep crashing instead of update..
Yes, it is correct.pilonstar wrote:just quick question:
it;s that code right?
Code: Select all
ReefAngel.RF.RadionChannels[Radion_Intensity]=75;
ReefAngel.RF.RadionChannels[Radion_White]=PWMParabola(12,0,18,0,0,100,0);
ReefAngel.RF.RadionChannels[Radion_RoyalBlue]=PWMParabola(9,0,22,0,0,100,0);
ReefAngel.RF.RadionChannels[Radion_Red]=PWMParabola(9,0,22,0,0,5,0);
ReefAngel.RF.RadionChannels[Radion_Green]=PWMParabola(9,0,22,0,0,10,0);
ReefAngel.RF.RadionChannels[Radion_Blue]=PWMParabola(10,0,21,0,0,60,0);
if (second()==0) ReefAngel.RF.RadionWrite();
Hi Roberto:rimai wrote:Let's start with the vortech.
Did you sync them to the controller?
Code: Select all
// Autogenerated file by RAGen (v1.2.2.171), (05/02/2012 22:36)
// RA_050212_2236.ino
//
// This version designed for v0.9.0 or later
/* The following features are enabled for this File:
#define wifi
#define SIMPLE_MENU
#define PWMEXPANSION
#define CUSTOM_MAIN
#define COLORS_PDE
#define ENABLE_ATO_LOGGING
#define RFEXPANSION
#define FONT_8x16
#define NUMBERS_8x16
*/
#include <ReefAngel_Features.h>
#include <RA_Colors.h>
#include <RA_CustomColors.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 <RF.h>
#include <ReefAngel.h>
////// Place global variable code below here
// Globals Needed for Params on Custom Main
byte x,y;
char text[10];
// Globals Needed for RF Mode on Custom Main
byte vtechmode;
boolean bFeeding=false;
byte PWMChannel[]={
0,0,0,0,0,0};
int v;
////// Place global variable code above here
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
//Top Banner
ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_SKYBLUE, 9, 2, " Erick&SooZ ReeF ");
// Display T1 Header Text
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,8,14,"Tank");
// Display the T1 Temp Value
char text[7];
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
ReefAngel.LCD.Clear(255, 4, 21, 37, 37);
ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE, 255, 4, 24, text, Num8x16);
pingSerial();
// Display the T2 Header Text
ReefAngel.LCD.DrawText(COLOR_CRIMSON,255,52,14,"Room");
// Display the T2 Temp Value
ConvertNumToString(text, ReefAngel.Params.Temp[T2_PROBE], 10);
ReefAngel.LCD.Clear(255, 52, 21, 75, 37);
ReefAngel.LCD.DrawLargeText(COLOR_CRIMSON, 255, 52, 24, text, Num8x16);
pingSerial();
// Display pH Header Text
ReefAngel.LCD.DrawText(COLOR_INDIGO,255,108,14,"pH");
// Display pH Value
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.Clear(255, 94, 21, 106, 37);
ReefAngel.LCD.DrawLargeText(COLOR_INDIGO, 255, 94, 24, text, Num8x16);
pingSerial();
// Display Vortech MP40wES Mode Header Text
ReefAngel.LCD.Clear(DefaultFGColor,5,39,127,39);
ReefAngel.LCD.DrawText(0,255,18,42,"EcoSmart Vortech");
// Display EcoSmart Mode Value
ReefAngel.LCD.Clear(255, 1, 49, 128, 64);
if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,50,"Constant");
else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,50,"Lagoon");
else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,50,"Reef Crest");
else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,50,"Short Pulse");
else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,50,"Long Pulse");
else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,50,"Nutrient Trnsp.");
else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,50,"Tidal Swell");
else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,50,"Night");
ReefAngel.RF.RadionChannels[Radion_Intensity]=75;
ReefAngel.RF.RadionChannels[Radion_White]=PWMParabola(12,0,18,0,0,100,0);
ReefAngel.RF.RadionChannels[Radion_RoyalBlue]=PWMParabola(9,0,22,0,0,100,0);
ReefAngel.RF.RadionChannels[Radion_Red]=PWMParabola(9,0,22,0,0,5,0);
ReefAngel.RF.RadionChannels[Radion_Green]=PWMParabola(9,0,22,0,0,10,0);
ReefAngel.RF.RadionChannels[Radion_Blue]=PWMParabola(10,0,21,0,0,60,0);
if (second()==0) ReefAngel.RF.RadionWrite();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 103, TempRelay);
}
void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph(5, 5);
}
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.SetTemperatureUnit(1); // set to Celsius Temperature
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit;
// Ports that are always on
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.On(Port8);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port4);
ReefAngel.StandardFan(Port6);
////// Place your custom code below here
ReefAngel.Portal("pilonstar", "whatupbrah");
//------------------------------ Start Feeding Mode Schedule (Start 1st Feeding at 9:55 AM and 2nd at 1:55 PM)---------------------
// if the hour is 9a or 1p, minute is 55 and seconds is 0
// start the feeding mode
if ( ((hour() == 9) || (hour() == 13)) &&
(minute() == 55) &&
(second() == 0) )
{
ReefAngel.FeedingModeStart();
vtechmode = InternalMemory.RFMode_read();
}
//------------------------------------------------------ End of Feeding Mode Schedule ---------------------------------------------
//-------------------------------------------------------- Start RF Daytime Control -----------------------------------------------
if (hour() >=8 && hour() <= 22)
{
if (ReefAngel.DisplayedMenu==FEEDING_MODE) bFeeding=true;
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding )
{
bFeeding=false;
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Smart_NTM,155,5);
ReefAngel.Timer[4].SetInterval(1800); // Timer for 30min
ReefAngel.Timer[4].Start();
vtechmode = 5;
}
if (ReefAngel.DisplayedMenu==DEFAULT_MENU && ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.RF.UseMemory=true;
vtechmode = InternalMemory.RFMode_read();
}
}
//---------------------------------------------------------- End RF Daytime Control -----------------------------------------------
//-------------------------------------------------------- Start RF Nightmode Control ---------------------------------------------
if (hour()>=23 || hour()<7) // Defining "Nightmode" hours for VorTech = between 11 PM and 7 AM
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Night,15,0);
vtechmode = 9;
}
else
{
ReefAngel.RF.SetMode(Feeding_Stop,0,0); //Temp fix for coming out of Night mode
ReefAngel.RF.UseMemory=true;
vtechmode = InternalMemory.RFMode_read();
}
//---------------------------------------------------------- End RF Nightmode Control ---------------------------------------------
//------------------------------------------------------ End Time-of-Day Based Functions ------------------------------------------
// This should always be the last line
ReefAngel.ShowInterface();
}
//--------------------------------------------------------------- End Loop --------------------------------------------------------
//*********************************************************************************************************************************
Sorry I didn't mean to confused you.rimai wrote:Confused.
What are you talking about?
The vortechs don't sync or the radions don't sync?
Did you sync the vortechs? Are they working as intended?
Hi Robertorimai wrote:The radion cannot be programmed to any mode.
You need to reset to factory settings and leave it like that. I think it's called basic mode.
If you have more than 1, you can't sync them together either, or they will just override the RA commands.
In basic mode, they will start accepting the commands from RA.
Excellent, I had a few issues with the modes and the firmware when I tried to install.rimai wrote:If you ever want to go back to the original firmware, here it is.
Code: Select all
@echo off
cmd
