oled屏自定义大小字体 micropython 使用 |
您所在的位置:网站首页 › stm32字体放大 › oled屏自定义大小字体 micropython 使用 |
项目地址:https://github.com/maysrp/ssd1306_font 支持设备:esp8266 esp32 树莓派pico等micropython设备 支持OLED SSD1306 0.96寸 (128x64)0.91 寸(128x32) 使用方法 上传 ASC16 ASC24 ASC32 font.py ssd1306.py 到你到设备 导入库 并初始化一个oled对象 from machine import I2C, Pin from ssd1306 import SSD1306_I2C from font import Font import time i2c = I2C(scl=Pin(0), sda=Pin(2)) display= SSD1306_I2C(128, 32, i2c)#我这里使用oled是128x32,如果是128x64 请将32变为64 f=Font(display)#初始化一个display对象 f.text("8",0,0,8) #8 pix f.text("16",8,0,16) #16 pix f.text("24",24,0,24) #24 pix f.text("32",48,0,32) #32 pix #参数 显示文字,x轴位置,y轴位置,文字大小 (8,16,24,32) f.show()#显示 清屏使用oled默认到fill函数 display.fill(0) f.show() * 我使用的是esp01s+ssd1306的oled |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |