Exit water change mode programmatically?

Do you have a question on how to do something.
Ask in here.
Post Reply
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Exit water change mode programmatically?

Post 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
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Exit water change mode programmatically?

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Exit water change mode programmatically?

Post by rimai »

Use this:

Code: Select all

ButtonPress++;
Roberto.
WIReefer83
Posts: 15
Joined: Fri Jan 01, 2016 2:58 pm

Re: Exit water change mode programmatically?

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Exit water change mode programmatically?

Post by rimai »

It should work as you described and not reboot.
Roberto.
WIReefer83
Posts: 15
Joined: Fri Jan 01, 2016 2:58 pm

Re: Exit water change mode programmatically?

Post 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
Post Reply