# Татарников Вадим k0711-23
import utime
from machine import Pin,I2C
from lcd_api import LcdApi
from pico_i2c_lcd import I2cLcd
import time
I2C_ADDR = 0x27
I2C_NUM_ROWS = 2
I2C_NUM_COLS = 16
i2c = I2C(0, sda=machine.Pin(0), scl=machine.Pin(13), freq=400000)
watch = I2C(1, sda=machine.Pin(2), scl=machine.Pin(11))
lcd = I2cLcd(i2c, I2C_ADDR, I2C_NUM_ROWS, I2C_NUM_COLS)
utime.sleep(1)
lcd.clear()
lcd.move_to(0,0)
while True:
lcd.clear()
seconds = watch.readfrom_mem(104,0x00,1).hex()
minutes = watch.readfrom_mem(104,0x01,1).hex()
hours = watch.readfrom_mem(104,0x02,1).hex()
lcd.putstr(hours + ':' + minutes + ':' + seconds)
utime.sleep(0.8)