How to turn off an 'always on' port a few times a day?

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
oscarinw
Posts: 31
Joined: Fri Apr 19, 2013 1:00 pm

How to turn off an 'always on' port a few times a day?

Post by oscarinw »

Hi folks,

I'm trying to figure out a code to help me turn off port 8 that's currently setup as an 'always on' port. I need to turn it off for 20 minutes at 2 or 3 specific times of the day. I have an automatic feeder that I will program to work at those times. Currently dealing with food getting wasted from too much flow when feeding. If someone can use 11am and 4pm for a suggested code, that'd be great. Feel free to point me in the direction of the right thread if it already exists.
Thanks in advance!
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: How to turn off an 'always on' port a few times a day?

Post by binder »

you could do it 2 different ways :
1. set port 8 to be off during feeding mode and then setup to trigger feeding mode at those times of day.
2. specifically turn off port 8 during those times if day.

how do you trigger your auto feeder? is it separate from the ra?
do you use feeding mode on the ra?

I'm just asking more questions up front to get a better idea on what will be the most versatile to do.
you can do it several ways, but the simplest way is usually the best and doing it so you don't have to reimplement other stuff is also good.
someone else will most likely chime in with a code sample for you.

Sent from my Moto X
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to turn off an 'always on' port a few times a day?

Post by rimai »

You can use it like this:

Code: Select all

ReefAngel.Relay.On(Port8);
if (hour()==11 && minute()<20) ReefAngel.Relay.Off(Port8);
if (hour()==16 && minute()<20) ReefAngel.Relay.Off(Port8);
Roberto.
User avatar
oscarinw
Posts: 31
Joined: Fri Apr 19, 2013 1:00 pm

Re: How to turn off an 'always on' port a few times a day?

Post by oscarinw »

binder wrote: how do you trigger your auto feeder? is it separate from the ra?
do you use feeding mode on the ra?
You are right. The feeder is independent from the RA. I don't use feeding mode.
User avatar
oscarinw
Posts: 31
Joined: Fri Apr 19, 2013 1:00 pm

Re: How to turn off an 'always on' port a few times a day?

Post by oscarinw »

rimai wrote:You can use it like this:

Code: Select all

ReefAngel.Relay.On(Port8);
if (hour()==11 && minute()<20) ReefAngel.Relay.Off(Port8);
if (hour()==16 && minute()<20) ReefAngel.Relay.Off(Port8);
This does it!
I just tested it and works perfectly. The idea is just now to have the feedings scheduled in the middle of the 'off' time of the flow pumps and synchronize the clocks every couple of months or so.
Thanks a lot!
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: How to turn off an 'always on' port a few times a day?

Post by binder »

oscarinw wrote:
rimai wrote:You can use it like this:

Code: Select all

ReefAngel.Relay.On(Port8);
if (hour()==11 && minute()<20) ReefAngel.Relay.Off(Port8);
if (hour()==16 && minute()<20) ReefAngel.Relay.Off(Port8);
This does it!
I just tested it and works perfectly. The idea is just now to have the feedings scheduled in the middle of the 'off' time of the flow pumps and synchronize the clocks every couple of months or so.
Thanks a lot!
perfect. then you can have different functionality in the future if you ever changed how you did stuff.


Sent from my iPad mini
Post Reply