Page 1 of 1

Adjust dosing pump with joystick

Posted: Thu Feb 16, 2012 4:53 pm
by Adam
Hi, I was woundering if there is a way I can change the seconds that each dosing pump runs with the joy stick on the controler. I don't have the wifi yet, and I would like to be able to increase or decrease the amount of time each pump runs with out taking it out and hooking it to my pc every time I want to change the seconds pump 1 and pump 2 run. I know it would be a custom menu but I don't know how to make a custom menu that will let me change the seconds the pumps run. Can this be done from the joystick on the controler or is it way more codding than I can do...which is almost none.

Re: Adjust dosing pump with joystick

Posted: Thu Feb 16, 2012 6:50 pm
by rimai

Re: Adjust dosing pump with joystick

Posted: Thu Feb 16, 2012 6:52 pm
by rimai
Also, if you use this on the features file, it will enable the setup with joystick:

Code: Select all

#define DosingPumpSetup

Re: Adjust dosing pump with joystick

Posted: Thu Feb 16, 2012 7:38 pm
by Adam
Thanks, I didn't think it was that easy. I've been looking in the libraries and watching tutotrals and yet most of this is still over my head.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 9:37 am
by Adam
I'm getting an error reefangelclass has no member named DosingPumpSetup. It is high lighting the Void MenuEntry1. I guess I don't have the proper wording for what I want the menu to do and I'm not sure on what I need to put in.

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 09:10)
// RA_021712_0910.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define DisplayImages
#define DateTimeSetup
#define DisplayLEDPWM
#define DosingPumpSetup
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 3
*/


#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>

#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Dosing Pump";
prog_char menu1_label[] PROGMEM = "PH Calibration";
prog_char menu2_label[] PROGMEM = "Date / Time";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label };

void MenuEntry1()
{
ReefAngel.DosingPumpSetup(); <---here is the error, how do I fix it
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry2()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry3()
{
ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}


void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
}

void loop()
{
// Specific functions
ReefAngel.StandardLights(Port4);
ReefAngel.DosingPump1(Port5);
ReefAngel.DosingPump2(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardFan(Port8);

ReefAngel.PWM.SetActinic(PWMSlope(10,0,22,0,15,100,60,15));
ReefAngel.PWM.SetDaylight(PWMSlope(11,0,21,0,0,100,60,0));

ReefAngel.ShowInterface();
}

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 9:57 am
by rimai
You can't use custom menu nor simple menu.
Use this features file:

Code: Select all

#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define DosingPumpSetup

#endif  // __REEFANGEL_FEATURES_H__
And this code:

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 09:10)
// RA_021712_0910.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayImages
#define DateTimeSetup
#define DisplayLEDPWM
#define DosingPumpSetup
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 3
*/


#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

// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
}

void loop()
{
// Specific functions
ReefAngel.StandardLights(Port4);
ReefAngel.DosingPump1(Port5);
ReefAngel.DosingPump2(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardFan(Port8);

ReefAngel.PWM.SetActinic(PWMSlope(10,0,22,0,15,100,60,15));
ReefAngel.PWM.SetDaylight(PWMSlope(11,0,21,0,0,100,60,0));

ReefAngel.ShowInterface();
}

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 11:17 am
by Adam
Ok I think I got it, hows this look?

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 12:11)
// RA_021712_1211.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__

#define DisplayImages
#define DosingPumpSetup
#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define StandardLightSetup
#endif // __REEFANGEL_FEATURES_H__

*/


#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

// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
}

void loop()
{
// Specific functions
ReefAngel.StandardLights(Port4);
ReefAngel.DosingPump1(Port5);
ReefAngel.DosingPump2(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardFan(Port8);

ReefAngel.PWM.SetActinic(PWMSlope(10,0,22,0,15,100,60,15));
ReefAngel.PWM.SetDaylight(PWMSlope(11,0,21,0,0,100,60,0));

ReefAngel.ShowInterface();
}

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 11:20 am
by rimai
I just want to make sure you understand that the features file I mentioned is an actual file located at "Document\Arduino\libraries\ReefAngel_Features.h"
You have to replace the contents of it with what I posted above.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:16 pm
by binder
Yeah, those setup screens require a lot of space to include them. That is why the simple and custom menus have most of them removed.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:23 pm
by Adam
I do now. Thanks for the help, sorry for being a pain in the ass.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:24 pm
by rimai
No pain at all...
Glad you got it working :)

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:33 pm
by Adam
OK this is what was in that file
#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define DisplayImages
#define DosingPumpSetup
#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define StandardLightSetup


#endif // __REEFANGEL_FEATURES_H__
Do I replace it with exactly what you posted.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:36 pm
by rimai
You can use the one you have.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:43 pm
by Adam
Ok, so this should be it? :oops:
// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 12:11)
// RA_021712_1211.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define DisplayImages
#define DosingPumpSetup
#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define StandardLightSetup
*/


#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

// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
}

void loop()
{
// Specific functions
ReefAngel.StandardLights(Port4);
ReefAngel.DosingPump1(Port5);
ReefAngel.DosingPump2(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardFan(Port8);

ReefAngel.PWM.SetActinic(PWMSlope(10,0,22,0,15,100,60,15));
ReefAngel.PWM.SetDaylight(PWMSlope(11,0,21,0,0,100,60,0));

ReefAngel.ShowInterface();
}

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:46 pm
by rimai
Try it :)
Let me know if it works.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 12:54 pm
by Adam
yeah I think i already noticed it wont work, its 31400 bytes and my internal memory is 4944 bytes. 4088 bytes to much.

Re: Adjust dosing pump with joystick

Posted: Fri Feb 17, 2012 2:45 pm
by rimai
Just use the one I gave you then.

Re: Adjust dosing pump with joystick

Posted: Sat Feb 18, 2012 8:27 am
by Adam
Good news, it worked. I can change Dosing pump 1 and 2 time it comes on and the seconds they run. I can also change standerd light time , heater/fan temp, calibrate ph,feeding mode, and water change mode. It will run pwmslope but you can't change the values, you can manualy chage the % the leds are at. It still has all the display of temp, ph,led, and sockets. This is the perfect program thanks to ALOT of help from Roberto!

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 12:11)
// RA_021712_1211.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define DisplayImages
#define DosingPumpSetup
#define DateTimeSetup
#define VersionMenu
#define DisplayLEDPWM
#define StandardLightSetup
*/


#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

// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
}

void loop()
{
// Specific functions
ReefAngel.StandardLights(Port4);
ReefAngel.DosingPump1(Port5);
ReefAngel.DosingPump2(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardFan(Port8);

ReefAngel.PWM.SetActinic(PWMSlope(10,0,22,0,15,100,60,15));
ReefAngel.PWM.SetDaylight(PWMSlope(11,0,21,0,0,100,60,0));


ReefAngel.ShowInterface();
}

Re: Adjust dosing pump with joystick

Posted: Sat Feb 18, 2012 9:53 am
by rimai
Nice :)

Re: Adjust dosing pump with joystick

Posted: Sun Feb 19, 2012 12:24 pm
by Adam
I was checking my dosing pumps at the time they were supose to run I noticed they are not running at all. The pumps still work but the controller isn't turning on plugs 5 and 6. On the display screen the 5 and 6 stay red. I have it set to run at 10 am for 40 seconds.

Re: Adjust dosing pump with joystick

Posted: Sun Feb 19, 2012 2:56 pm
by rimai
Bug :(
Thanks for finding it!!!
I fixed it.
Will release soon.

Re: Adjust dosing pump with joystick

Posted: Sun Feb 19, 2012 6:08 pm
by Adam
Hey if you need it broken I'm your man.

Re: Adjust dosing pump with joystick

Posted: Sun Feb 19, 2012 8:11 pm
by rimai
Curt just told me he pushed 0.9.1.
Do you want to try it now?
You can update your libraries with the update utility.
http://www.reefangel.com/update

Re: Adjust dosing pump with joystick

Posted: Mon Feb 20, 2012 5:46 am
by Adam
Yes, I will down load it and try it. I will besure to run the updater again in a few days incase MR.Bender changes something.

Re: Adjust dosing pump with joystick

Posted: Mon Feb 20, 2012 6:00 am
by Adam
I did a dry run right here at my desk, and it did turn on the port for my dosing pump. I will watch today and make sure everything works right.

Re: Adjust dosing pump with joystick

Posted: Thu Feb 23, 2012 8:08 am
by Adam
Had a strange issue with my dosing pump last night. The pumps kicked on at 8pm when they are clearly set to run one time at 10am for 45 seconds. I have not noticed if they have run at any other times I haven't watched it that close. Only thing I can come up with is in the internal memory it has DP1 and DP2 repeatinterval_write (60). But when I made the code with RAGen I did not select dosingpump repeat interval.
I will reload the internal memory with 0 next to the repeat interval to see if that fixes it.

Re: Adjust dosing pump with joystick

Posted: Thu Feb 23, 2012 9:04 am
by rimai
I think you just found another bug :(
I think what is happening is that when we changed the code to this new method, we broke a fundamental requirement that it is supposed to be used one time only.
What is happening right now is that because you set it to 10am, the controller calculates how many minutes from midnight it should run, in this case, it is 600 minutes (10hours). Then, every 600 minutes, it will do that again. Which means that at 1200 minutes (8pm) it will repeat the cycle.
I'll have to work on a fix to this bug.
If you schedule the dosing in the pm instead of am, it will only dose once, until I get a fix for this.

Re: Adjust dosing pump with joystick

Posted: Thu Feb 23, 2012 9:27 am
by Adam
OK I think I have one more for you. I watched the pumps run at 10am, dp1 is set by the controller to run for 45 sec. Dp2 is set to run 40 secin the internal memory. They both ran 40 sec. So changing the setting from the controller isn't working either. I think I will just unplug the pumps for now and dose manually may alk has gone up to fast in the past 2 days.

Re: Adjust dosing pump with joystick

Posted: Sat Feb 25, 2012 9:53 pm
by rimai
Please download the latest libraries using the update utility.
http://www.reefangel.com/update

Re: Adjust dosing pump with joystick

Posted: Mon Feb 27, 2012 6:50 pm
by Adam
It seems to be working, looks like that fixed it. Thanks again for all the help.