Page 1 of 1

toggling a port

Posted: Sun Mar 04, 2012 6:41 pm
by rossbryant1956
looking for a post on just toggling a port at certain times. I will use it switch on\off my salt water reservoir barrel. Saw this, is there a better way?
dmolton wrote: You can use the StandardLights function in your RA PDE sketch file to control on/off times for you LEDs.

the function looks like this:

StandardLights(byte LightsRelay, byte OnHour, byte OnMinute, byte OffHour, byte OffMinute)

so you inside the loop() function of your sketch the line will look something similar to this:

Code: Select all

ReefAngel.StandardLights(2,10,0,21,30);
The above line will turn on Port 2 at 10:00 AM and turn it off at 9:30 PM
Even better would be an entry in my "soon to be built" custom main menu that allowed me to override, start, and stop this function.

Re: toggling a port

Posted: Sat Mar 24, 2012 6:46 am
by binder
The use of the "StandardLights" function is simply for a timed port.

You can do an entry in the custom menu that would force the port ON/OFF. You would need either 2 functions: 1 to turn ON and 1 to turn OFF. Or you could make it toggle ON/OFF based on how many times you chose the menu option.
This thread does something similar to that, but only for LEDs. http://forum.reefangel.com/viewtopic.ph ... ggle#p7175