Reading internal memory in loop()
Posted: Tue Nov 11, 2014 5:00 am
I have set up my wavemakers so I can set the strength and duration in internal memory. Now im wondering if it would be better to maybe store that in a variable at initialisation and run that through the loop rather than reading the internal memory everytime the loops runs. I imagine it cycles pretty quickly, and may be better read from volatile memory? Or does it not really matter? Heres a snippet of the code I am running. The only downside I can see to reading the memory at initialisation and storing it in a variable is that I would have to reboot the RA for the changes to take place. Any words of wisdom?
Ive also set my skimmer to delay coming on but was wondering if my code after that would overide the delay. I have a few lines that will turn the skimmer off if the float switches in the collection drum activate. Also to turn it off if it is sucking water out of the sump quicker than the ATO can replace it. I need to make sure these three functions work in the correct order I guess.
Thanks
Code: Select all
ReefAngel.PWM.SetDaylight( ReefCrestMode(InternalMemory.read(Mem_B_PHDayPower),InternalMemory.read(Mem_B_PHDuration),true) );
Ive also set my skimmer to delay coming on but was wondering if my code after that would overide the delay. I have a few lines that will turn the skimmer off if the float switches in the collection drum activate. Also to turn it off if it is sucking water out of the sump quicker than the ATO can replace it. I need to make sure these three functions work in the correct order I guess.
Code: Select all
ReefAngel.Relay.DelayedOn( Skimmer );
if (ReefAngel.WaterLevel.GetLevel() < InternalMemory.read(Mem_B_SkimmerWL) ) ReefAngel.Relay.Off(Skimmer);
if (ReefAngel.LowATO.IsActive() && ReefAngel.HighATO.IsActive())
{
ReefAngel.Relay.On(Skimmer);
}
else
{
ReefAngel.Relay.Off(Skimmer);
}