from machine import Pin,PWM, SoftI2C
from ssd1306 import SSD1306_I2C
import time
#定义OLED对象
i2c = SoftI2C (scl=Pin(12),sda=Pin(14))
oled = SSD1306_I2C(128,64,i2c,addr = 0x3c)
Beep = PWM(Pin(19),freq = 1,duty = 128)

Beep.freq(294)
oled.text('1',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(330)
oled.text('2',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(350)
oled.text('3',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(393)
oled.text('4',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(441)
oled.text('1',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(495)
oled.text('1',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()

Beep.freq(556)
oled.text('1',60,30)
oled.show()
time.sleep(2)
oled.fill(0)
oled.show()