Page 1 of 1

Exit water change mode programmatically?

Posted: Fri May 17, 2013 9:42 pm
by Piper
Is there a way to exit the water change mode programmatically? i.e. If I want to use the IO module to trigger the water change mode using ReefAngel.WaterChangeModeStart() how can I get out of feeding mode? Or simulate a button press...

Code: Select all

    // Clear the auto feeder
    if (autoFeederTriggered == true) {
      IOSetChannel(IO_Port_1,LOW); // Sets channel 0 to LOW
      autoFeederTriggered = false;
    }

    if(!ReefAngel.IO.GetChannel(IO_Port_6)) {
      // Trigger the auto feeder
      IOSetChannel(IO_Port_1,HIGH); // Sets channel 0 to HIGH
      autoFeederTriggered = true;
    }

    if(!ReefAngel.IO.GetChannel(IO_Port_5)) {
      // ReefAngel.FeedingModeStart();
      
      // Strart water change mode
      ReefAngel.WaterChangeModeStart();
      ReefAngel.CustomVar[6] = 6;
    }
~Charlie

Re: Exit water change mode programmatically?

Posted: Fri May 17, 2013 10:05 pm
by Piper
After reading through this exchange with Kurt and Nick I think my answer is in ReefAngelClass::ExitMenu().

I'll test it out in the morning and see if that does the trick for me.

~Charlie

Re: Exit water change mode programmatically?

Posted: Fri May 17, 2013 10:11 pm
by rimai
Use this:

Code: Select all

ButtonPress++;

Re: Exit water change mode programmatically?

Posted: Mon Jan 04, 2016 6:54 pm
by WIReefer83
How does the RA react to the ButtonPress++? I have this at the end of my water change code and it does return to the main screen, but it almost seems like a reboot. The screen goes blank while the red light is blinking quickly. Then the Reef Angel logo comes up and the RA returns to normal.

Is this the expected result of simulating the button push? Thx

Re: Exit water change mode programmatically?

Posted: Mon Jan 04, 2016 10:05 pm
by rimai
It should work as you described and not reboot.

Re: Exit water change mode programmatically?

Posted: Tue Jan 05, 2016 9:17 pm
by WIReefer83
I figured this out. I was leaving the RA connected to my PC, which was causing random reboots. I disconnected the USB and the button press code worked as expected. Thx