import time
from machine import SoftI2C,Pin
from ssd1306 import SSD1306_I2C
i2c = SoftI2C(sda=Pin(12), scl=Pin(13))
oled = SSD1306_I2C(128, 64, i2c, addr=0x3c)
Human=Pin(4,Pin.IN,Pin.PULL_UP)
oled.fill(0)
oled.text("qinlikai", 0, 0)
oled.text("sirenlingyu:", 0, 15)
oled.show()
def fun(Human):
for i in range(5):
oled.fill(0)
oled.text("zaicijinggao", 0, 0)
oled.text("sirenlingyu:", 0, 15)
oled.text("qingxusulikai!!!", 0, 40)
oled.show()
time.sleep_ms(500)
oled.fill(0)
oled.text("qingpeihe", 0, 0)
oled.text("thanks", 0, 15)
oled.text(" ", 0, 40)
oled.show()
time.sleep_ms(500)
Human.irq(fun,Pin.IRQ_RISING)