Hi,
i need help coding my zeolite reactor on port 2:
I need to switch on port 2 at 11.00 and 23.00 for 2 minutes then OFF for the rest of the day.
Thanks for your help
Help
Re: Help
Hi,
That seems like a pretty arcane way to do this.
How about:
I think that would be simpler and is certainly more readable.
Don
That seems like a pretty arcane way to do this.
How about:
Code: Select all
ReefAngel.Relay.Set (Port2, (hour() == 11 || hour() == 23) && minute() < 2);
Don
Re: Help
Its certainly a good way, but not the best long term and for many who do time based operations can lead to the wrong actions. Yes it is more readable, but its less flexible for many of the repeat scheduling people want to do. The way I try to explain the previous usage would bededvalson wrote:Hi,
That seems like a pretty arcane way to do this.
How about:
I think that would be simpler and is certainly more readable.Code: Select all
ReefAngel.Relay.Set (Port2, (hour() == 11 || hour() == 23) && minute() < 2);
Don
(now() + offset) % repeat < runtime
Hope that helps clarify. Fun part of coding is coming up with different ways to accomplish things. Always good to see different ideas.