Can Speed and Duration be retained per each DC Pump mode?

Community contributed apps

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Sun Dec 21, 2014 10:37 pm
I recently started using the DC Pump code using the Reef Angel portal and the Reef Angel U-App to set the parameters used to operate my Tunze 6105 powerhead and everything seems to be working fine. :D After testing various DC Pump modes and values I found a few settings that seem to work well in my tank, but the ideal speed and duration parameters vary slightly between each DC Pump modes.

For example: DC Pump Mode = Long Pulse with speed = 75 and Duration = 2. Or DC Pump Mode = Nutrient Export with speed = 100 and duration = 40.

I notice when I change the DC Pump modes using the RA portal or RA U-app the speed and duration parameters remain whatever were previously selected.

For example if I was using DC Pump Mode = Long Pulse with speed = 75 and Duration = 2 and I use RA U-App to change DC Pump Mode = Nutrient Export the speed will remain 75 and duration will remain 2 (not my ideal settings of speed = 100 and duration = 40).

I would like to be able to set preset values for each DC Pump mode for duration and speed that are retained so I don’t have to remember what my preferred settings are each time I change the DC Pump mode. Is there a way to accomplish this and continue to use the portal and RA U-app to change the DC Pump modes and save DC Pump settings? If not, please create some code that would allow me to set the presets in my .INO and continue to use the RA portal and RA U-App to change the DC Pump mode. If it would also allow me to override the presets using the RA Portal and RA U-App that would be a nice option too. Not a deal breaker, though. ;)

Thanks for your assistance.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Dec 22, 2014 5:49 am
I could write you some code for that. It could even just change the presets when the mode changes so if you wanted to customize after you could.

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Mon Dec 22, 2014 10:10 am
lnevo wrote:I could write you some code for that. It could even just change the presets when the mode changes so if you wanted to customize after you could.


Lee, that sounds perfect. Thanks.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Dec 22, 2014 12:15 pm
Here's the example. You can change the Mode and settings to the ones you want. If you want to add more, you'll need to just copy the entire case {} block.

The way it works is if the DCPump mode changes, it will update the memory for speed and duration, thus allowing you to retain the desired settings on each mode. Once the mode has been changed you can go ahead and update speed and duration to whatever you want with no circumstance. It will only update to your defaults if/when the mode changes.

Code: Select all
    static byte prevDCPumpMode = InternalMemory.DCPumpMode_read();
    if (ReefAngel.DCPump.Mode != prevDCPumpMode) {
      prevDCPumpMode=ReefAngel.DCPump.Mode;
       
      switch(ReefAngel.DCPump.Mode) {
        case ShortPulse: {
          InternalMemory.DCPumpSpeed_write(50);
          InternalMemory.DCPumpDuration_write(10);
          break;
        }
        case LongPulse: {
          InternalMemory.DCPumpSpeed_write(50);
          InternalMemory.DCPumpDuration_write(10);
          break;
        }
      }
    }

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Mon Dec 22, 2014 10:42 pm
Works great! Thanks Lee.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Dec 23, 2014 8:30 am
Sweet! :)

Return to Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron