from machine import I2C, Pin
from utime import sleep_ms
from hcsr04 import HCSR04
from ssd1306 import SSD1306_I2C
import ds1307
i2c = I2C(sda=Pin(21), scl=Pin(22))
ds = ds1307.DS1307(i2c)
oled = SSD1306_I2C(128, 32, i2c)
#now = (2018,8, 8, 2, 13, 45, 0) #Year Munt monthday weekday Hour Minute second
#ds.datetime(now)
ds.datetime()
mont=("JAN","FEB","MAR","APR","MAY","JUN","JUL", "AUG","SEP","OCT","NOV", "DEC")
DayOfWeek = ("Mon","Tue","Wed","Thu","Fri","Sat","sun")
while True:
  DT = ds.datetime()
  print(DT)
  oled.fill(0)

  oled.text(DayOfWeek[DT[3]-1],0,0)
  oled.text(str(DT[2]), 30,0)
  oled.text(mont[DT[1]-1],45,0)
  oled.text(str(DT[0]),75,0)

  oled.text(str(DT[4]), 30,20)
  oled.text(':',45, 20)
  oled.text(str(DT[5]), 50,20)
  oled.text(':', 65, 20)
  oled.text(str(DT[6]), 70, 20)
  oled.show()
  sleep_ms(100)
GND5VSDASCLSQWRTCDS1307+