from machine import Pin, SoftI2C
from time import sleep
from i2c_lcd import I2cLcd
led_red = Pin(8, Pin.OUT)
i2c = SoftI2C(scl=Pin(1), sda=Pin(0), freq=400000)
print("I2C address found:", i2c.scan())
lcd = I2cLcd(i2c, 0x27, 2, 16)
led_red.on()
for detik in range(5, 0, -1):
lcd.clear()
lcd.putstr(f"Lampu merah\n{detik} detik...")
sleep(1)
# Setelah countdown selesai
led_red.off()
lcd.clear()
lcd.backlight_off()