fromssd1306importinitialize,clear_oledfromssd1306_bitmapimportshow_bitmapinitialize()clear_oled()show_bitmap("microbit_logo") 3.4 set_px(x, y, color, draw=1) Paints the pixel at position x, y (of a 64x32 coordinate system) with the corresponding color (0 dark or 1 lighted). If the...
'''实验名称:OLED显示屏(I2C总线)版本:v1.0日期:2019.4作者:01Studio'''frommachineimportI2C,Pin#从machine模块导入I2C、Pin子模块fromssd1306importSSD1306_I2C#从ssd1306模块中导入SSD1306_I2C子模块i2c=I2C(sda=Pin(5),scl=Pin(4))#pyBoard I2C初始化:sda--> Y8, scl --> Y6oled=SSD1306_I2C(128,6...
在程序中我们直接引用已经写好的ssd1306.py的oled库函数,只需要copy到控制板中引用就可以了。人生苦短,我们学会调用函数即可,初学者无需重复造轮子 *oled = SSD1306_I2C(width, height, i2c, addr) 构 OLED 显示屏对象。width:屏幕宽像素;height: 屏幕高像素;i2c:定义好的I2C 对象; addr:显示屏设备地址 *ol...
驱动芯片:ssd1306 2、硬件连接: 3、加载ssd1306驱动: 方法:在Thonny上将ssd1306.py保存(上传)到ESP32设备就OK了 ssd1036.py代码 # MicroPython SSD1306 OLED driver, I2C and SPI interfaces frommicropythonimport const import framebuf # register definitions SET_CONTRAST = const(0x81) SET_ENTIRE_ON = con...
cd module_library ampy --port COMX put ssd1306.py [注]请注意,并不是开启下方的窗口,若出现下方窗口,则要再按一次开启系统命令行。 5. 如何查看已汇入的函式库 在Thonny IDE 中,点选检视 -> 档案,可以查看Raspberry Pi Pico W中汇入的档案 ...
Step 1. Download the ssd1306.py library and open it with Thonny. Step 2. Click "File-->Save as" and save the library in the "Raspberry Pi Pico"Chose the "Raspberry Pi Pico" as the location we save.Make sure the saved file name is "ssd1306.py", otherwise it will not work....
# create SSD1306 interface display_width:int = 128 display_height:int = 64 oled = ssd1306.SSD1306_I2C(128, 64, i2c) # turn on all pixels oled.fill(1) # make the change oled.show() # show the update time.sleep(1) # turn off all pixels (blank display) ...
packed-font - Memory efficient MicroPython fonts for the Pico Pi and SSD1306 OLED Display. microfont - Text drawing library for MicroPython framebuffer. Graphics micropython-stage - A MicroPython port of the Stage game library. micropython-png - Derivative of PyPNG for use with MicroPython. mpy...
(0x8D) # Subclassing FrameBuffer provides support for graphics primitives # http://docs.micropython.org/en/latest/pyboard/library/framebuf.html class SSD1306(framebuf.FrameBuffer): def __init__(self, width, height, external_vcc): self.width = width self.height = height self.external_vcc =...
nanogui.pyThe library. writer.pyModule for rendering Python fonts. fplot.pyThe graph plotting module. colors.pyColor constants. Contents 2.1.2 Demo scripts Thegui/demosdirectory contains test/demo scripts. Demos for small displays: mono_test.pyTests/demos using the official SSD1306 driver for a...