How Internal Memory Works
How Internal Memory Works
Can someone please explain how the internal memory works? Or share a link to more info.
I see where to modify it but not sure how to use or when to apply it.
Thanks
I see where to modify it but not sure how to use or when to apply it.
Thanks
Re: How Internal Memory Works
There are two ways to set parameters. One is in the code. For example:
Sets up a standard light timer on relay #1 that runs from 0900 to 1900 (9,0,19,0). These values are hard coded and cannot be changed without uploading new code. If I wanted my lights to shut off at 8:30 PM, I'd have to change the code to this and re-upload:
The other way to do this is with settings in memory. The equivalent code would be:
This says use the DayLights memory locations to set a timer on relay 1. This is only useful if you're on WiFi and can change the settings remotely with the Portal, U-App, or Android app.
The big difference is that you can change memory locations on the fly (using the Portal or an app) without having to upload new code every time you want to change a setting.
When you first generate in-the-memory code with the Wizard, it will generate a file to set the memory settings, then it will generate the code that actually runs the controller. You can use the memory settings code, or you can skip it and enter everything into the portal or apps manually.
--Colin
Code: Select all
ReefAngel.StandardLights( Port1,9,0,19,0 );
Code: Select all
ReefAngel.StandardLights( Port1,9,0,20,30 );
Code: Select all
ReefAngel.DayLights( Port1 );
The big difference is that you can change memory locations on the fly (using the Portal or an app) without having to upload new code every time you want to change a setting.
When you first generate in-the-memory code with the Wizard, it will generate a file to set the memory settings, then it will generate the code that actually runs the controller. You can use the memory settings code, or you can skip it and enter everything into the portal or apps manually.
--Colin
Re: How Internal Memory Works
If you browse through the internal memory section within the portal you'll see all the values that you can set. For instance you'll see the Heater section has the values for on/off. To make use of those values you'll need to change your code from hard coded to using internal memory. Here is an example of the change:
Before:
ReefAngel.StandardHeater(Port1,790,800);
After:
ReefAngel.StandardHeater(Port1);
Before:
ReefAngel.StandardHeater(Port1,790,800);
After:
ReefAngel.StandardHeater(Port1);
Re: How Internal Memory Works
ReefAngel.StandardHeater(Port1)
ReefAngel.StandardHeater(Port2)
So if you have this.. Two heaters.. Where is the temp value stored? And how do you change them individually?
ReefAngel.StandardHeater(Port2)
So if you have this.. Two heaters.. Where is the temp value stored? And how do you change them individually?
Re: How Internal Memory Works
You cannot change them individually. They will both use the values set in InternalMemory when used that way. You can use the internal thermostat on each one to fine tune it, or control it manually in the code.
Re: How Internal Memory Works
Excellent explanation Colin and Lee. I've always been a bit cloudy on that too.
Re: How Internal Memory Works
How do you enter everything into the portal or apps manually?cosmith71 wrote:You can use the memory settings code, or you can skip it and enter everything into the portal or apps manually.
--Colin
Re: How Internal Memory Works
On the Portal, click on internal memory. On the U-App, it's under settings.
--Colin
--Colin
Re: How Internal Memory Works
So it's as simple as removing the data from the end of the label and port identification?
Re: How Internal Memory Works
You can see every memory location if you look for the section with mem_ at the beginning of each line in this file
https://github.com/reefangel/Libraries/ ... /Globals.h
If you look at
https://github.com/reefangel/Libraries/ ... alEEPROM.h
You can look for function declarations that end with _read() to see how to get values in your code in the loop if there isn't already a function that uses those values.
https://github.com/reefangel/Libraries/ ... /Globals.h
If you look at
https://github.com/reefangel/Libraries/ ... alEEPROM.h
You can look for function declarations that end with _read() to see how to get values in your code in the loop if there isn't already a function that uses those values.
Re: How Internal Memory Works
I'm assuming that it is okay to use both internal memory and code?
Example:
I want to use internal memory for my daylights, actinic, moonlight, heaters, and dosers, but I want a special 2 hour daily timer for a solenoid valve, which would require the parameters to be set in code. (Since there is no way to have a specialized time schedule that is not daylight, actinic, or moonlight in the internal memory.)
I am going to try it tonight, but I figured I'd ask anyway
Example:
I want to use internal memory for my daylights, actinic, moonlight, heaters, and dosers, but I want a special 2 hour daily timer for a solenoid valve, which would require the parameters to be set in code. (Since there is no way to have a specialized time schedule that is not daylight, actinic, or moonlight in the internal memory.)
I am going to try it tonight, but I figured I'd ask anyway
Re: How Internal Memory Works
You can totally mix. You could also use variable locations 100-199 for custom variables. You just have to set through the http API or through the android app
Re: How Internal Memory Works
Could you explain a little more about using the variable locations? perhaps give a simple example of the variable, how it can relate to the port, and how it would be accessed through the API?
I'm a software engineer II if that helps you decide how to explain this to me. I'm used to Java and front end development, although I do have some building automation background. I'm not too familiar with arduino at all
I'm a software engineer II if that helps you decide how to explain this to me. I'm used to Java and front end development, although I do have some building automation background. I'm not too familiar with arduino at all
Re: How Internal Memory Works
Look at my INO I have declarations up top of all the custom memory locations I use.
You basically do an InternalMemory.read() and InternalMemory.write() to grab and set those variables. It's pretty basic. As a software engineer, I think you'll get it pretty quick.
You may want to peek at the library docs http://www.easte.net/ra/html
You basically do an InternalMemory.read() and InternalMemory.write() to grab and set those variables. It's pretty basic. As a software engineer, I think you'll get it pretty quick.
You may want to peek at the library docs http://www.easte.net/ra/html