Here is a crude way to do it. Turn it on at 3 PM and it will feed around 3 PM each day. The clock will probably drift a few minutes a day but it should be OK for a while. You can compensate for most of the drift. For example, if the feedings are averaging 3 minutes and 18 seconds earlier each day, add 3 minutes and 18 seconds to the timer interval.
if (currentMillis - lastMillis >= 24 * HOURS + (3 * MINUTES + 18 * SECONDS))
#include <Servo.h>
const unsigned long SECONDS = 1000;
const unsigned long MINUTES = 60 * SECONDS;
const unsigned long HOURS = 60 * MINUTES;
Servo AugerServo;
const byte AugerServoPin = 4;
const int StopAngle = 90;
unsigned long lastMillis = 0;
void Feed()
{
AugerServo.write(StopAngle);
AugerServo.attach(AugerServoPin);
AugerServo.write(180); // Full forward (use 0 for the other direction)
delay(10 * SECONDS);
AugerServo.write(StopAngle);
AugerServo.detach();
}
void setup()
{
Feed(); // Feed once on power up
}
void loop()
{
unsigned long currentMillis = millis();
// Feed every 24 hours after power up
if (currentMillis - lastMillis >= 24 * HOURS)
{
lastMillis += 24 * HOURS;
Feed();
}
}