# Литвинов Егор K0709-22/2
from machine import Pin, I2C
from ds1307 import DS1307
from utime import sleep
I2C_ADDR = 0x68
MONDAY = 0
WEDNESDAY = 2
FRIDAY = 4
led = Pin(9, Pin.OUT)
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c)
while True:
if ds1307.weekday in (MONDAY, WEDNESDAY, FRIDAY):
if ds1307.second < 11:
led.on()
else:
led.off()
print(ds1307.second)
sleep(0.5)