feeding mode code
Posted: Sun Aug 11, 2013 5:30 pm
I am having trouble getting my feeding mode to work again since installing my new relays. Here is a snippet of my code:
The ports that need to be toggled are on relay boxes 1 & 2: box1_port8 and box2_port8. The ports it is switching are: Box2_port1, box2_port3, and box2_port5. I haven't tested the water change mode but it will probably act the same way. Here is the code snippet I call feeding mode with.
Code: Select all
// Define Relay Ports by Name
#define DT_LightsOne 1
#define DT_LightsTwo 2
#define Unused3 3
#define Unused4 4
#define DT_LWM 5
#define GT_LWM 6
#define Unused7 7
#define Unused8 8
#define Unused11 Box1_Port1
#define Unused12 Box1_Port2
#define GT_LightsOne Box1_Port3
#define GT_LightsTwo Box1_Port4
#define DT_RWM Box1_Port5
#define GT_RWM Box1_Port6
#define DT_Heat Box1_Port7
#define DT_Pump Box1_Port8
#define RV_Heat Box2_Port1
#define RV_Pump Box2_Port2
#define GT_Heat Box2_Port3
#define Unused24 Box2_Port4
#define GT_OverFill Box2_Port5
#define GT_Fill Box2_Port6
#define Skimmer Box2_Port7
#define GT_Pump Box2_Port8
void setup() {
ReefAngel.Init(); //Initialize controller
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items)); // Initialize the menu
ReefAngel.FeedingModePortsE[0] = DT_Pump; // Turn off on Box1 when feeding mode is activated is activated
ReefAngel.FeedingModePortsE[1] = Skimmer | GT_Pump; // Turn off on Box2 when feeding mode is activated is activated
ReefAngel.WaterChangePorts = DT_LWM | GT_LWM ; // Turn off when water change mode is activated
ReefAngel.WaterChangePortsE[0] = DT_RWM | GT_RWM | DT_Heat | DT_Pump; // Turn off on Box1 when water change mode is activated
ReefAngel.WaterChangePortsE[1] = GT_Heat | GT_Pump | Skimmer | GT_Fill | RV_Heat; // Turn off on Box1 when water change mode is activated
Code: Select all
// if the hour is 2p or 8p, minute is 55 and seconds is 0, start the feeding mode
if ( ((hour() == 14) || (hour() == 20)) &&
(minute() == 55) &&
(second() == 0) )
{
ReefAngel.FeedingModeStart();
}