#include #include #define I2C_ADDR 0x27 //LCD i2c stuff #define BACKLIGHT_PIN 3 #define En_pin 2 #define Rw_pin 1 #define Rs_pin 0 #define D4_pin 4 #define D5_pin 5 #define D6_pin 6 #define D7_pin 7 LiquidCrystal_I2C lcd(6,7,8); void setup() { digitalWrite(6,HIGH); digitalWrite(7,HIGH); digitalWrite(8,HIGH); Serial.begin(9600); lcd.begin (16,2); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); lcd.setBacklight(HIGH); lcd.home (); lcd.setDs1302Time(15, 31, 15, 5, 12, 1, 2018); } void loop() { lcd.clear(); lcd.updateTime(); lcd.setCursor(0,0); lcd.print(lcd.dayofmonth); lcd.print("/"); lcd.print(lcd.month); lcd.print("/"); lcd.print(lcd.year); lcd.setCursor(0,1); lcd.print(lcd.hours); lcd.print(":"); lcd.print(lcd.minutes); lcd.print(":"); lcd.print(lcd.seconds); delay(1000); }