<I, wanna add a way to make it so when specific times and/or dates hit, the msg on the LCD will change to something else other then time and change back at the end of the day?
E.G saying its someones birthday on someones date or etc>
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "RTClib.h"
RTC_DS3231 rtc;
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup()
{
rtc.begin();
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
{
rtc.adjust(DateTime(F(DATE), F(TIME)));
}
#ifndef ESP8266
while (!Serial); // wait for serial port to connect. Needed for native USB
#endif
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
while (1) delay(10);
}
}
void loop(){
DateTime now = rtc.now();
lcd.setCursor(0,0);
lcd.print("Time: ");
lcd.print(now.hour(),DEC);
lcd.print(":");
lcd.print(now.minute(),DEC);
if(now.minute(),DEC > 10){
lcd.setCursor(8,0);
lcd.print("0");
lcd.print(now.minute(),DEC);
}
lcd.print(" o'Clock");
lcd.setCursor(0,1);
lcd.print("Date: ");
lcd.print(now.day(), DEC);
lcd.print('/');
lcd.print(now.month(), DEC);
lcd.print('/');
lcd.print(now.year(), DEC);
lcd.setCursor(0,3);
lcd.print("Temperature: ");
lcd.print(rtc.getTemperature());
lcd.print("C");
}