from machine import Pin, I2C #匯入i2c模組
import ssd1306 #匯入ssd1306資料庫
#ESP32 Pin assignment
i2c = I2C(0, scl=Pin(22), sda=Pin(21)) #i2c腳位設定
oled_width = 128 #x像素設定
oled_height = 64 #y像素設定
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)#oled板子定義
oled.text('Hello, Ardy', 10, 32) #oled顯示從 Hello, Ardy 從x=10 y=10開始
oled.show() #顯示