657 views|0 replies

6841

Posts

11

Resources
The OP
 

【Digi-Key Follow me Issue 3】Task 2 OLED Display Text and Chinese Characters [Copy link]

 
1. Download the ssd1306 package
After downloading, we upload this file to the development board:
  1. In the boot.py main program, we write the following code:
    from machine import Pin, SoftI2C
    import ssd1306py as lcd
    import math
    
    # ESP8266 Pin assignment
    i2c = SoftI2C(scl=Pin(7), sda=Pin(6))  # Adjust the Pin numbers based on your connections
    lcd.init_i2c(7,6,128,64)
    lcd.text('font8x8', 0, 0, 8)
    font16 = {
        0xe4bda0:
            [0x08, 0x08, 0x08, 0x11, 0x11, 0x32, 0x34, 0x50, 0x91, 0x11, 0x12, 0x12, 0x14, 0x10, 0x10, 0x10, 0x80, 0x80,
             0x80, 0xFE, 0x02, 0x04, 0x20, 0x20, 0x28, 0x24, 0x24, 0x22, 0x22, 0x20, 0xA0, 0x40],  # 你
        0xe5a5bd:
            [0x10, 0x10, 0x10, 0x10, 0xFC, 0x24, 0x24, 0x25, 0x24, 0x48, 0x28, 0x10, 0x28, 0x44, 0x84, 0x00, 0x00, 0xFC,
             0x04, 0x08, 0x10, 0x20, 0x20, 0xFE, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xA0, 0x40]  # 好
    }
    lcd.set_font(font16, 16)
    lcd.text('font16x16', 0, 20, 16)
    lcd.text_cn("你好", 0, 40, 16)
    
    lcd.show()

  2. Download to the development board, the display effect is as follows:
Attachment: ssd1306 package:
ssd1306py.zip (13.18 KB, downloads: 5)
This post is from DigiKey Technology Zone
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list