New to Coding with ATO Issue

New members questions
Post Reply
Lenny82
Posts: 4
Joined: Wed Jun 20, 2012 6:27 pm

New to Coding with ATO Issue

Post by Lenny82 »

I have watched/read all of the beginners videos and manuals. I got my controller up and running and have been trying to edit the ATO timeout code. I have seen several threads on how this was done and tried to mimic the code. I need to extend the ATO timeout code. I upload my code but still can't change the timeout. I am using the two float switch ATO with standard ATO function. My code is below. Any ideas as to what I am doing wrong?

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 <ReefAngel.h>

void setup()
{
  ReefAngel.Init(); // Initialize Controller
  ReefAngel.AddStandardMenu();
  ReefAngel.AddDateTimeMenu();  
  ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
  ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Ports 1, 5, 6, 7 and 8 when Water Change Mode is activated
  ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit | Port7Bit; // Turn off Ports 3, 4 and 7 when overheat occurs
  ReefAngel.LightsOnPorts = Port3Bit | Port4Bit; // Turn on/off Ports 3 and 4 when Light On/Off menu option is selected
  ReefAngel.OverheatProbe = T1_PROBE; // Use Temperature probe 1 to check for overheat
  ReefAngel.Relay.On(Port8); // Always on
}

void loop()
{
  ReefAngel.LCD.DrawLargeText(COLOR_STEELBLUE,COLOR_WHITE,28,121,"Reef Angel"); // Display Reef Angel banner
  ReefAngel.StandardATO(Port1, 900); // Standard ATO
  ReefAngel.MoonLights(Port2); // Moonlights or Refugium
  ReefAngel.StandardLights(Port3,30); // Actinic Lights
  ReefAngel.StandardLights(Port4,0); // Daylight Lights
  ReefAngel.Wavemaker1(Port5); // Wavemaker 1
  ReefAngel.Wavemaker2(Port6); // Wavemaker 2
  ReefAngel.StandardHeater(Port7); // Heater
  ReefAngel.PWM.StandardDaylight(); // Dimming for Daylight Channel
  ReefAngel.PWM.StandardActinic(30); // Dimming for Actinic Channel
  ReefAngel.ShowInterface(); // Display everything on the LCD screen
}




rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: New to Coding with ATO Issue

Post by rossbryant1956 »

Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Lenny82
Posts: 4
Joined: Wed Jun 20, 2012 6:27 pm

Re: New to Coding with ATO Issue

Post by Lenny82 »

Thanks Ross, I decided to just let the wizard figure it out for me. It seems to be working as intended now. I just can't modify it at the unit I will have to re-upload if I decide to change it. No biggie though.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New to Coding with ATO Issue

Post by binder »

Lenny82 wrote:Thanks Ross, I decided to just let the wizard figure it out for me. It seems to be working as intended now. I just can't modify it at the unit I will have to re-upload if I decide to change it. No biggie though.
You will have to modify your code to tell it to use the internal memory instead of being hard coded if you want to be able to change it on the fly. I'm not sure if the wizard does this for the ato or not. That is something to ask roberto about.
Lenny82
Posts: 4
Joined: Wed Jun 20, 2012 6:27 pm

Re: New to Coding with ATO Issue

Post by Lenny82 »

I would actually like to be able to adjust all the settings on the fly. The preloaded code worked well for me with the exception of the ATO function. Can anyone see why the time out won't go higher than the 250ish when I try to set it? I set the value to 900 in the code and I know the cap is around 37000.

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 <ReefAngel.h>

void setup()
{
  ReefAngel.Init(); // Initialize Controller
  ReefAngel.AddStandardMenu();
  ReefAngel.AddDateTimeMenu();  
  ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
  ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Ports 1, 5, 6, 7 and 8 when Water Change Mode is activated
  ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit | Port7Bit; // Turn off Ports 3, 4 and 7 when overheat occurs
  ReefAngel.LightsOnPorts = Port3Bit | Port4Bit; // Turn on/off Ports 3 and 4 when Light On/Off menu option is selected
  ReefAngel.OverheatProbe = T1_PROBE; // Use Temperature probe 1 to check for overheat
  ReefAngel.Relay.On(Port8); // Always on
}

void loop()
{
  ReefAngel.LCD.DrawLargeText(COLOR_STEELBLUE,COLOR_WHITE,28,121,"Reef Angel"); // Display Reef Angel banner
  ReefAngel.StandardATO(Port1, 900); // Standard ATO
  ReefAngel.MoonLights(Port2); // Moonlights or Refugium
  ReefAngel.StandardLights(Port3,30); // Actinic Lights
  ReefAngel.StandardLights(Port4,0); // Daylight Lights
  ReefAngel.Wavemaker1(Port5); // Wavemaker 1
  ReefAngel.Wavemaker2(Port6); // Wavemaker 2
  ReefAngel.StandardHeater(Port7); // Heater
  ReefAngel.PWM.StandardDaylight(); // Dimming for Daylight Channel
  ReefAngel.PWM.StandardActinic(30); // Dimming for Actinic Channel
  ReefAngel.ShowInterface(); // Display everything on the LCD screen
}



rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New to Coding with ATO Issue

Post by rimai »

It is a limitation of the libraries.
It will be changed on the new libraries, which are due to be released this weekend if everything goes right.
Roberto.
Lenny82
Posts: 4
Joined: Wed Jun 20, 2012 6:27 pm

Re: New to Coding with ATO Issue

Post by Lenny82 »

Awesome, thanks Roberto!
Post Reply