from machine import Pin, I2C
import time
import ssd1306
i2c = I2C(0, scl=Pin(4),sda=Pin(5))
display = ssd1306.SSD1306_I2C(128, 64, i2c)
def scroll(texto, repetir):
while True:
for y in range(64, -8, -1):
display.text(texto, display.width // 2 - len(texto)*4, y ,1)
display.show()
time.sleep(0.01)
display.fill(0)
display.show()
if not repetir:
break
scroll("Quiero dormir", False)
scroll("Ya", False)
scroll("Hola", False)