import time
from machine import Pin
from machine import SoftI2C
import ssd1306
from machine import PWM
pwm = PWM(Pin(15),freq = 50)
i2c = SoftI2C(scl=Pin(21),sda = Pin(22))
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width,oled_height,i2c)
pwm.duty(50)
time.sleep(2)
pwm.duty(70)
time.sleep(2)
pwm.duty(120)
time.sleep(2)
while True:
oled.text("hai jihan",32,0)
for i in range (0,120):
oled.scroll(0,1)
oled.show()
time.sleep(0.1)
Loading
ssd1306
ssd1306