Turn outlets on/off from joystick?

Basic / Standard Reef Angel hardware
Post Reply
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Turn outlets on/off from joystick?

Post by lnevo »

Most people dont use the screen joystick enough to warrant it in my opinion. You have access to water change mode and feeding modes from the menu. If theres another common device you want to toggle i have code for that in my ino. I do that for my refugium light.

If you dont have the wifi but have a laptop you could use the windows client.

It certainly could be done but its quite a bit of code especially when you could have up to 72 relays each with explicit on/off/auto
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Turn outlets on/off from joystick?

Post by lnevo »

Maybe a two line screen where you can left/right to run through all the ports and then you press down to the next line and pick the operation then down to OK/Cancel buttons
Kungpaoshizi
Posts: 52
Joined: Wed Sep 16, 2015 8:12 am

Re: Turn outlets on/off from joystick?

Post by Kungpaoshizi »

cosmith71 wrote:I'm sure it could be added by a strong enough programmer. :D

--Colin
I'm tryin to.. heh
If it weren't for my c# goggles this would be going much faster... :D
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Turn outlets on/off from joystick?

Post by binder »

everyone is correct about it being a bit tricky to do this. it's not a highly suggested thing either. it can be done though. one thing you have to keep in mind is the code size increases when doing this. it may not be a problem now with the Plus but it certainly was with the standard ra when it was originally being coded.
if you are doing this, when you get the screen created to toggle the ports, while you are waiting for the input you will need to make sure you are letting the ra check its status and handle all its events. the current code does this, so try to mimic that. im just saying don't go creating one function that listens for a response before it returns or proceeds, otherwise your tank won't function properly.
with that being said, have fun coding it! customize it to your hearts content.

Sent from my Moto X
Kungpaoshizi
Posts: 52
Joined: Wed Sep 16, 2015 8:12 am

Re: Turn outlets on/off from joystick?

Post by Kungpaoshizi »

Been so busy I haven't made any progress.

Lnevo could I get that code you have, might be able to adapt some of it.

I see if I press the joystick left, 3 times, I get a screen, the list of relays, labeled with their status, a color and then Port #.
That screen would be perfect to be able to arrow down through, click/scroll to select the state.

Anyone know which source file contains that? I've looked through a lot of code but am still fumbling a bit :)

Tyvm though, any other thoughts are quite welcome!
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Turn outlets on/off from joystick?

Post by lnevo »

This is what I use in my menu. You have to follow the thread that explains how to customize the menu to add this. This function toggles the port on / off depending on it's state

Code: Select all

void MenuEntry1() {
  // Toggle refugium light between on/auto.
  ReefAngel.Relay.Override(Refugium, ReefAngel.Relay.Status(Refugium)+1);
  ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
Mirror176
Posts: 6
Joined: Tue Aug 04, 2015 12:02 am
Location: Phoenix, AZ
Contact:

Re: Turn outlets on/off from joystick?

Post by Mirror176 »

Definitely able to be coded. Code allowed feeding/water change/lighting modes out of the box which controls outlets as groups. I seem to have lost lighting control through menu since starting to reprogram it from what the wizard generated for me and haven't looked into it but feeding and water change modes still work.
Post Reply