What is the port supposed to do. Just cause the code you posted is gonna run that port for 2 minutes every 6 hours.
Try and put the following before the if statement.
ReefAngel.Relay.Off(Box2_Port6);
Is that the port your using anyway? You have to change the code to use the correct port. I don't see any Box1 or other Box2 ports...
Countdown timer for relay
28 posts
• Page 3 of 3 • 1, 2, 3
Facepalm
![]() |
|
Awesome. Can you post your final code that you used.
|
|
I ran into some issues last night, but think it's working now. I'll post the code once I'm sure it's stable and correct, just doing a little testing today.
|
|
Here's what I ended up with. It runs for one hour and repeats every two days. , I have to wait two days to be sure it actually repeats, but I think it will:
|
|
Cool and triggering manually is working? What are you automating here?
|
|
Yep, when I toggle the relay from the app it opens the relay for the set amount of time (60 minutes currently) and shuts off again. It then runs automatically every two days for 60 minutes.
I'm using this code to control a solenoid on my RODI system. It refills my fresh water container on a regular basis and other containers on demand. My fresh water container has a shut off float in it, but I overflowed other water containers too many times, so it's nice to have something that will shut off automatically. I wonder if this function could be built into the app that would allow one to start a countdown timer for any relay, after which the relay would return to its normal function. Seems like something a lot of people would use, and would be a lot simpler than changing to code frequently. |
|
I have a class in the libraries called TimedPort that does this. I would recommend looking at the water level sensor module and then just using the WaterLevelATO function to control the solenoid.
|
|
28 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 2 guests