from machine import Pin, I2C
import time
import ssd1306
width = 128
height = 64
i2c = I2C(scl=Pin(22), sda=Pin(21))
oled = ssd1306.SSD1306_I2C(width, height, i2c)
oled.text("Hello... AST!", 0, 0)
oled.text("MicroPython", 0, 15)
oled.show()
time.sleep(2)
w = int(width/2)
h = int(height/2)
while 1:
for i in range(4):
oled.fill(0) #fill black
if i==0:
oled.fill(1) #fill blue
oled.text("fill", 0, 5, 0)
elif i==1:
oled.fill_rect(0, 20, w, h, 1)
oled.text("fill rect", 0, 0)
elif i==2:
oled.pixel(w, h, 1)
oled.text("pixel", 0, 0)
elif i==3:
oled.scroll(10, 10)
oled.text("scroll", 0, 0)
oled.show()
time.sleep(1)