v0.9.0 Libraries

Related to the development libraries, released by Curt Binder
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

lukeluke wrote:the max repeat time is 4 hour ?
No. I was just using that as an example for repeat. The maximum number for repeat is 32767 minutes. That is well above 4 hours. It will work if you exceed 24 hours (1440 minutes).
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

projectx wrote:This compiles without any errors, is this the proper way?
ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
Yeah, that's the "preferred" way with 0.9.X libraries. The reason is that it's more "human readable" and easier to understand. You could put it in terms of the 0's & 1's but that's just a little harder to read.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

int RepeatMinute variable can handle 32768 minutes.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: v0.9.0 Libraries

Post by rossbryant1956 »

projectx wrote: ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
What is this syntax? E[0]

Haven't seen that before. Thx
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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

E[0] is for expansion relay box.
You can have E[0] through E[7] to set the ports of all other expansion boxes.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Great Thanks just did a few comparisons from the old to the new, just have to learn the code, I have found that Notepad++ is great for making it readable vs notepad
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

projectx wrote:Great Thanks just did a few comparisons from the old to the new, just have to learn the code, I have found that Notepad++ is great for making it readable vs notepad
I love Notepad++ on windows. It works so much better than notepad. :)
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

So I have something thats amiss with my expansion relay. from the portal I am able to turn on n off my pumps, but with the new code they are not being turned on.
here is my INO file

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

/* The following features are enabled for this File:
#define DirectTempSensor
#define wifi
#define RelayExp
#define InstalledRelayExpansionModules 1
#define SIMPLE_MENU
#define ENABLE_ATO_LOGGING
#define ENABLE_EXCEED_FLAGS
*/


#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.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit | Port6Bit;
ReefAngel.LightsOnPorts = Port2Bit | Port4Bit | Box0_Port1 | Box0_Port2;
ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit | Port5Bit | Port6Bit;

// Ports that are always on
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Box0_Port3);
ReefAngel.Relay.On(Box0_Port4);
ReefAngel.Relay.On(Box0_Port7);
ReefAngel.Relay.On(Box0_Port8);
}

void loop()
{
// Specific functions
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.StandardLights(Box0_Port1, 21, 0, 7, 0);
ReefAngel.StandardLights(Box0_Port2, 7, 0, 20, 0);
ReefAngel.MHLights(Box0_Port5);
ReefAngel.MHLights(Box0_Port6);
ReefAngel.MHLights(Port4);
ReefAngel.StandardHeater(Port6);
ReefAngel.DosingPump1(Port7);
ReefAngel.DosingPump2(Port8);
;

ReefAngel.ShowInterface();
}
Image
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

I have real problems now, my ATO is staying on all of the time, I stripped out all of the expansion box items as it started to happen when my moon lights (box0_port1) were scheduled to come on.

I repushed the code and it is still on, thankfully i was sitting there when it did it so i was able to pull the plug on the pump before I had a mess to clean up.

Any ideas?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

The ATO is because your code is should use Box1_ instead of Box0_
Box0_ refers to the main relay box.
The Dosing pump is because there was a bug that was fixed today.
Please download the latest libraries using the update utility.
http://www.reefangel.com/update
It was a premature move to update the dosing pump code and I had to return back to the original code.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Ok I am getting the update now, odd, i stripped all of the code for the expansion out and it was still doing it.
Image
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Thanks, that took care of it, and it also solved a few other things that i was fighting
Image
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: v0.9.0 Libraries

Post by lukeluke »

on your last library, 0.9.6 , you add the function:

SingleATOHighExtended(byte Relay);

i add it on my .ino and i compile it right.

I must modify the ATOHighTimeout .... how can i do ?

Can i use your java ReefAngel Status changing the variable from byte to int ? for example i want 10 minutes. Can i set on the location 842 the value INT 600 ?

Thanks

Bye
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

lukeluke wrote:on your last library, 0.9.6 , you add the function:

SingleATOHighExtended(byte Relay);

i add it on my .ino and i compile it right.

I must modify the ATOHighTimeout .... how can i do ?

Can i use your java ReefAngel Status changing the variable from byte to int ? for example i want 10 minutes. Can i set on the location 842 the value INT 600 ?
First, I haven't made a post about the new functions and how to use them, so that's my fault.

Second, here's your answer. You can use those functions instead of the regular ones. The extended functions use different memory locations that the standard ones. The reason is the extended ato functions use INT variables and not BYTE variables. Here's the memory locations for the new functions:

Code: Select all

Mem_I_ATOExtendedTimeout   876
Mem_I_ATOHighExtendedTimeout  878
You can use the java status to update the values. For the ATOHighExtended function, you will use 878 for the location and the value is an INT and set it to 600.
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: v0.9.0 Libraries

Post by lukeluke »

ok Curt.

thanks a lot .

you are the best ;-) :-P
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

I thought I read/heard somewhere alone the way that there was an update coming to the libraries soon. Is that the case? I'm getting reading to setup the RA+, add a dosing pump, and make a few other changes, but figured I'd hold off if a library update was coming soon. Thanks!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

Libraries updates will always be released. We are constantly evolving the code and it is thanks to you all that make this project move forward. Some bugs can only be found in a real environment.
There is also always request for new functions and such, so don't hold off on an update or you will be holding off for a very long time as there will always be another one coming up :)
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

Yeah, like Roberto said, there's always updates coming out. So don't hold off "playing" just because you are waiting for another update. :)
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

Thanks guys. I worked up some new code and took a stab at installing the RA+ board this morning. Had some oddball stuff going on. My moonlights started to turn on and off and my leds didn't seem to be reading the internal memory settings. I ended up putting the old board back in until I have time to trouble shoot it. I'll be back with questions. :)
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

rimai wrote:E[0] is for expansion relay box.
You can have E[0] through E[7] to set the ports of all other expansion boxes.
Does E[0] automatically refer to the first relay expansion box or does it need reference the ID that is set up using the expansion module dip switches?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

E[0] references to the ID 1 and so on.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Mike S wrote:Thanks guys. I worked up some new code and took a stab at installing the RA+ board this morning. Had some oddball stuff going on. My moonlights started to turn on and off and my leds didn't seem to be reading the internal memory settings. I ended up putting the old board back in until I have time to trouble shoot it. I'll be back with questions. :)
I had the same issue I am guessing your moonlights are in port 5 or 6. I am going to take another stab at it this weekend. Need to get the memory updated first then push the code to it I'll let you know what happens

Sent from my Galaxy Nexus using Tapatalk 2
Image
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

My moonlight are on 5 and 6 but I had uploaded it with the wrong board setting. When I uploaded it again last night with the RA+ setting they worked fine. My leds, heater and ato were not so lucky. I think my LED issue may have been due to a mh delay setting. Need to double check that.... One step at a time. :-)
Post Reply