4th doser

Do you have a question on how to do something.
Ask in here.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Mar 01, 2018 5:36 am
What's the best way to code a 4th doser?

I assume this will work to have it come on 4 times during the day and run for 1 minute each time, but it's a little inflexible.

Code: Select all
  if (((hour() == 10) || (hour() == 14) || (hour() == 18) || (hour() == 22)) && (minute() < 1)) { // run autofeeder for 1 minute at 10,2,6,10
    ReefAngel.Relay.On(Box1_Port5);         
  } else {                             
    ReefAngel.Relay.Off(Box1_Port5);
  }


I'd probably take out the fixed hours and time and find an unused internal memory location to stick the values in, but this is a standing for now.

Posts: 12241
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Mar 01, 2018 8:15 am
I would go with something like this:
Code: Select all
ReefAngel.Relay.Set(Port1,now()%3600<5);
Roberto.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Mar 01, 2018 8:30 am
Clever. I like it. Thanks!

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 3 guests

cron