Need help with programming plz

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)

GarrettT

Well-Known Member
View Badges
Joined
Apr 23, 2021
Messages
913
Reaction score
659
Location
Austin, TX
Rating - 0%
0   0   0
I'm looking to program my Apex to do the following.

Turn on at 7:10am to 7:25am
Turn off when float switch is triggered

If the float switch is triggered, how would it turn off if I am asking it to be on at the same time?
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
Your question isn't very clear, but I think this is what you want:

Set OFF
If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF

Two points to clarify:
1. The end time is listed as 7:24 because the If Time values are inclusive. In other words, while the clock still reads 7:24 it will remain on, then once the clock reaches 7:25 it will turn off.
2. You didn't specify what your float reports when "triggered". Is it normally OPEN, or normally CLOSED. Adjust the code for your situation.

See my series of Apex tutorials for details on a variety of topics:
 
OP
OP
GarrettT

GarrettT

Well-Known Member
View Badges
Joined
Apr 23, 2021
Messages
913
Reaction score
659
Location
Austin, TX
Rating - 0%
0   0   0
Neptune questions are always hard to translate.

So the float switch "Then OFF'' would take precedence over the time period ''Then ON"?

If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
Neptune questions are always hard to translate.

So the float switch "Then OFF'' would take precedence over the time period ''Then ON"?

If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF
The Apex evaluates each line of code from top to bottom, and the last line that's True will set the output state. It repeats this process once per second. So if the float reports CLOSED, that last line of the program is True, so it turns the output off even if it's still within the time window from the previous line of code.
 

Creating a strong bulwark: Did you consider floor support for your reef tank?

  • I put a major focus on floor support.

    Votes: 56 40.3%
  • I put minimal focus on floor support.

    Votes: 29 20.9%
  • I put no focus on floor support.

    Votes: 49 35.3%
  • Other.

    Votes: 5 3.6%
Back
Top