#include <U8g2lib.h>
#include <Wire.h>
#include <RtcDS1307.h>
#include <SoftwareWire.h>

U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
SoftwareWire myWire(A3,9);
RtcDS1307<SoftwareWire> Rtc(myWire);

void setup(){
  u8g2.setI2CAddress(0x3C*2);
  u8g2.begin();
  Rtc.Begin();
  Rtc.SetIsRunning(true);
  Rtc.SetDateTime(RtcDateTime("Dec/31/2020", "23:59:20"));
  u8g2.enableUTF8Print();

}

void loop(){
  u8g2.firstPage();
  do
  {
    u8g2.setFont(u8g2_font_timR18_tf);
    u8g2.setFontPosTop();
    u8g2.setCursor(0,0);
    u8g2.print(String(String(Rtc.GetDateTime().Year()) + String(" ")) + String(String(Rtc.GetDateTime().Month()) + String(" ")) + String(Rtc.GetDateTime().Day()));
    u8g2.setCursor(0,20);
    u8g2.print(String(String(Rtc.GetDateTime().Hour()) + String(" ")) + String(String(Rtc.GetDateTime().Minute()) + String(" ")) + String(Rtc.GetDateTime().Second()));
  }while(u8g2.nextPage());

}