#include <DateTime.h>
#include <DateTimeStrings.h>
#include <Ethernet.h>
byte mac[] = { 0x33, 0x25, 0x71, 0x33, 0x38, 0x40 }; // whatever mac you want
byte ip[] = { 192, 168, 1, 247 }; //My IP
byte clockserver[] = { 64, 90, 182, 55 };
int cur_time;
void setup () {
Ethernet.begin(mac, ip);
Client clocksystem(clockserver, 37); //connect to TIME server
if (clocksystem.connect()) {
cur_time = clocksystem.read();
DateTime.sync(cur_time);
clocksystem.stop();
}
}
void loop() {
if( DateTime.Hour = 07) {
//feed fish at 7 in the morning
}
}
I'm trying to create a timer that feeds my fish at 7am and grabs the time from the TIME server. I'm away from my home right now (and arduino) so I just need to know If this will do what I want it to or if it will just not work...