feed and W/C mode switching wrong ports
-
- Posts: 43
- Joined: Mon Jan 30, 2012 10:02 pm
feed and W/C mode switching wrong ports
Feed mode is turning off my lights and one wavemaker. WC mode is turning off my lights, one wavemaker and dose pump. How do I modify the code in order to switch which ports are turned off during the modes?
Re: feed and W/C mode switching wrong ports
You will need to alter the ports being toggled in your setup() function. You will need to add and edit these lines:
You need to place a 1 in the port position you wish to turn off during the modes. The above example turns off ports 8, 6, & 5 in each of those modes.
Code: Select all
// Starting from the left, it's Ports 87654321
ReefAngel.FeedingModePorts = B10110000;
ReefAngel.WaterChangePorts = B10110000;
-
- Posts: 43
- Joined: Mon Jan 30, 2012 10:02 pm
Re: feed and W/C mode switching wrong ports
Thank you but I am not sure where to put that. This is the code I am using:binder wrote:You will need to alter the ports being toggled in your setup() function. You will need to add and edit these lines:You need to place a 1 in the port position you wish to turn off during the modes. The above example turns off ports 8, 6, & 5 in each of those modes.Code: Select all
// Starting from the left, it's Ports 87654321 ReefAngel.FeedingModePorts = B10110000; ReefAngel.WaterChangePorts = B10110000;
Code: Select all
// Autogenerated file by RAGen (v1.1.0.127), (01/31/2012 16:02)
// Memory_013112_1602.pde
//
// This file sets the default values to the Internal Memory
//
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
void setup()
{
e.lcd_init();
e.lcd_clear(COLOR_WHITE,0,0,132,132);
e.lcd_BacklightOn();
InternalMemory.MHOnHour_write(14);
InternalMemory.MHOnMinute_write(30);
InternalMemory.MHOffHour_write(20);
InternalMemory.MHOffMinute_write(30);
InternalMemory.MHDelay_write(0);
InternalMemory.StdLightsOnHour_write(14);
InternalMemory.StdLightsOnMinute_write(0);
InternalMemory.StdLightsOffHour_write(21);
InternalMemory.StdLightsOffMinute_write(0);
InternalMemory.DP1OnHour_write(20);
InternalMemory.DP1OnMinute_write(0);
InternalMemory.DP2OnHour_write(22);
InternalMemory.DP2OnMinute_write(30);
InternalMemory.DP1Timer_write(10);
InternalMemory.DP2Timer_write(10);
InternalMemory.DP1RepeatInterval_write(60);
InternalMemory.DP2RepeatInterval_write(60);
InternalMemory.ATOTimeout_write(255);
InternalMemory.ATOHighTimeout_write(255);
InternalMemory.ATOHourInterval_write(0);
InternalMemory.ATOHighHourInterval_write(0);
InternalMemory.FeedingTimer_write(900);
InternalMemory.LCDTimer_write(600);
InternalMemory.LEDPWMActinic_write(99);
InternalMemory.LEDPWMDaylight_write(99);
InternalMemory.WM1Timer_write(200);
InternalMemory.WM2Timer_write(354);
InternalMemory.HeaterTempOn_write(790);
InternalMemory.HeaterTempOff_write(800);
InternalMemory.ChillerTempOn_write(810);
InternalMemory.ChillerTempOff_write(785);
InternalMemory.OverheatTemp_write(820);
InternalMemory.PHMax_write(840);
InternalMemory.PHMin_write(550);
}
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.lcd_draw_text(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.lcd_draw_text(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.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
sprintf(buf, "WM1: %ds", InternalMemory.WM1Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, buf);
sprintf(buf, "WM2: %ds", InternalMemory.WM2Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, "F: %ds", InternalMemory.FeedingTimer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "S: %ds", InternalMemory.LCDTimer_read());
e.lcd_draw_text(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.lcd_draw_text(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.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*10, buf);
sprintf(buf, "PH %d - %d", InternalMemory.PHMax_read(), InternalMemory.PHMin_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*11, buf);
delay(10000);
e.lcd_clear(COLOR_WHITE,0,0,132,132);
sprintf(buf, "OH: %dF", InternalMemory.OverheatTemp_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
sprintf(buf, "ATO L: %ds (%dh)", InternalMemory.ATOTimeout_read(), InternalMemory.ATOHourInterval_read());
e.lcd_draw_text(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.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
sprintf(buf, "DP1: %2d:%02d", InternalMemory.DP1OnHour_read(), InternalMemory.DP1OnMinute_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
sprintf(buf, " %ds", InternalMemory.DP1Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
sprintf(buf, "DP2: %2d:%02d", InternalMemory.DP2OnHour_read(), InternalMemory.DP2OnMinute_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
sprintf(buf, " %ds", InternalMemory.DP2Timer_read());
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*8, buf);
delay(10000);
e.lcd_clear(COLOR_WHITE,0,0,132,132);
}
-
- Posts: 43
- Joined: Mon Jan 30, 2012 10:02 pm
Re: feed and W/C mode switching wrong ports
figured it out. Thanks so much!
Re: feed and W/C mode switching wrong ports
The code you posted was the SetInternalMemory file. I was referring to using your standard code file for your controller. Regardless, it sounds like you have it figured out.