#include "LiquidCrystal_I2C.h"
#include "iarduino_RTC.h"
#include "Wire.h"
iarduino_RTC time(RTC_DS1307);
#define I2C_ADDR 0x27
#define LCD_COLUMNS 20
#define LCD_LINES 4
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
void setup () {
delay(300);
Serial.begin(9600);
time.begin();
time.settime(0, 30, 18, 12, 6, 20, 5); // 0 сек, 30 мин, 18 часов, 12, июня, 2020, четверг
lcd.init();
lcd.backlight();
}
void loop () {
if (millis()%1000==0){
lcd.setCursor(0,0);
lcd.print(time.gettime("d M Y, D"));
lcd.setCursor(4,1);
lcd.print(time.gettime("H:i:s"));
delay(1);
}
}