Code to turn on Feeding mode ?
Code to turn on Feeding mode ?
How would I code this to turn on feeding mode at a certain time, instead of using the app or portal.
Re: Code to turn on Feeding mode ?
This is some code that will trigger a Ehiem Auto Feeder at 6pm and at the same time put the system in Feeding mode.
Maybe you can take something from this.
Maybe you can take something from this.
Code: Select all
static unsigned long feeding = 0;
if ((now()%SECS_PER_DAY==64800)) //if it is 6 pm
{
ReefAngel.FeedingModeStart(); //START FEEDING MODE
}
if (ReefAngel.DisplayedMenu==FEEDING_MODE)
{
if ( feeding == 0 ) {
feeding = now(); //set the time of the start of feeding to variable feeding
}
if ((now()-feeding>=60) && (now()-feeding<=61)) //if between 60 and 61 seconds has past
{
ReefAngel.Relay.On(Feeder); //TURN FEEDER RELAY ON
}
else
{
ReefAngel.Relay.Off(Feeder); //TURN FEEDER RELAY OFF
}
} else {
if ( feeding > 0 ) {
feeding = 0;
}
}
Re: Code to turn on Feeding mode ?
ReefAngel.FeedingModeStart
Thats what I needed, do I need to tell it to go off or will it still go off after a certain time like it does now
Thats what I needed, do I need to tell it to go off or will it still go off after a certain time like it does now
Re: Code to turn on Feeding mode ?
I think the feeding will end after whatever duration you have set in the internal memory.
Mine is set for 900 seconds or 15 min.
Mine is set for 900 seconds or 15 min.
Re: Code to turn on Feeding mode ?
That worked perfect, thanks