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. 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.
Can Speed and Duration be retained per each DC Pump mode?
Re: Can Speed and Duration be retained per each DC Pump mode
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.
Re: Can Speed and Duration be retained per each DC Pump mode
Lee, that sounds perfect. Thanks.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.
Re: Can Speed and Duration be retained per each DC Pump mode
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.
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;
}
}
}
Re: Can Speed and Duration be retained per each DC Pump mode
Works great! Thanks Lee.