Enable I2C4 in rsetup
Connect pins:
GND - GND
VCC - 3.3v or 5V
SDA - 27
SCL - 28
pip install adafruit-circuitpython-ssd1306
wget https://github.com/yohasebe/rsyntaxtree/blob/master/fonts/wqy-zenhei.ttf
vim test.py
import board
import busio
import adafruit_ssd1306
from PIL import Image, ImageDraw, ImageFont
FONTSIZE = 24
font = ImageFont.truetype("wqy-zenhei.ttf", FONTSIZE) #put the font file under the same dir
i2c = busio.I2C(board.D4_B3, board.D4_B2)
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
oled.fill(0)
oled.show()
image = Image.new("1", (oled.width, oled.height))
draw = ImageDraw.Draw(image)
draw.text((0, 0), "测试", font=font, fill=255)
oled.image(image)
oled.show()