#include "RTClib.h"
RTC_DS1307 rtc;
boolean night_mode=false;
void setup () {
Serial.begin(115200);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
abort();
}
}
void loop ()
{
DateTime now = rtc.now();
if(now.hour()>=22 || now.hour()<=6)
{
night_mode=true;
Serial.println("NIGHT MODE");
}
else
night_mode=false;
}