How Internal Memory Works

New members questions

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Fri Jan 02, 2015 10:19 pm
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
Image
User avatar
Posts: 1426
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City
PostPosted: Sat Jan 03, 2015 6:40 am
There are two ways to set parameters. One is in the code. For example:

Code: Select all
    ReefAngel.StandardLights( Port1,9,0,19,0 );


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:

Code: Select all
    ReefAngel.StandardLights( Port1,9,0,20,30 );


The other way to do this is with settings in memory. The equivalent code would be:

Code: Select all
    ReefAngel.DayLights( Port1 );


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
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Jan 03, 2015 6:58 am
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);

Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm
PostPosted: Sat Jan 03, 2015 12:28 pm
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?
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Jan 03, 2015 3:00 pm
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.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Sat Jan 03, 2015 6:13 pm
Excellent explanation Colin and Lee. I've always been a bit cloudy on that too.

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Mon Jan 05, 2015 4:08 am
cosmith71 wrote:You can use the memory settings code, or you can skip it and enter everything into the portal or apps manually.

--Colin


How do you enter everything into the portal or apps manually?
Image
User avatar
Posts: 1426
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City
PostPosted: Mon Jan 05, 2015 4:18 am
On the Portal, click on internal memory. On the U-App, it's under settings.

--Colin

Posts: 73
Joined: Fri Feb 13, 2015 4:58 pm
PostPosted: Tue Apr 14, 2015 10:35 pm
So it's as simple as removing the data from the end of the label and port identification?
Image

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Wed Apr 15, 2015 11:39 am
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.
Next

Return to For New Members

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron