572 views|2 replies

8

Posts

1

Resources
The OP
 

[Digi-Key Electronics Follow me Issue 2] + Task 1: Control the screen to display Chinese [Copy link]

 This post was last edited by Shi Xiaojie on 2023-11-3 11:13

Project introduction: By learning the Adafruit ESP32-S3 TFT Feather development board, you can control the screen and display Chinese.

Before starting the task, you need to download the corresponding version of the library from the link below. Since CircuitPython 8 is used, just choose the recommended 8.x version package. The link is https://circuitpython.org/libraries . One folder is the lib package and the other folder is the example package.

I further discovered that if I wanted to display Chinese, I needed a suitable Chinese font. After referring to online materials and reference designs by predecessors, I found that the following fonts could be used:

链接已隐藏,如需查看请登录或者注册

Download it, here I choose wenquanyi_10pt.pcf to CIRCUITPY disk

Then add adafruit_bitmap_font and adafruit_display_text 2 libraries to the lib file as shown below

After adding the supporting libraries, the next step is to write the code:

First, add the library according to the syntax of CircuitPython

Then set the initialization parameters. After displaying Chinese fonts here, the LED is continuously flipped in the loop.

code show as below:


import board
import digitalio
import time
import displayio

from adafruit_display_text import label
from adafruit_bitmap_font  import bitmap_font

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

display = board.DISPLAY
board.DISPLAY.brightness = 0.5  #亮度
board.DISPLAY.rotation = 0

str_disp_0 = "欢迎参加Flow Me\n这是第二期"

font = bitmap_font.load_font("lib\wenquanyi_10pt.pcf")
color = 0xFFFFFF   #字体颜色

text_group = displayio.Group()
text_area = label.Label(font, text=str_disp_0, color=color)
text_area.x = 20    #显示的X轴
text_area.y = 20    #显示的Y轴

#启动屏幕显示
text_group.append(text_area)
display.show(text_group)

while True:
    if(led.value == True):
        led.value = False
    else:
        led.value = True

    time.sleep(2)

The experimental phenomena are as follows:

100ab1d1e10b8e845f614a6f05d84e0e

Experience: First of all, I would like to thank Digi-Key Electronics for hosting this event. I am still a student and only know a little bit of 32. It was also during this event that I came into contact with CircuitPython. It is really convenient and it is also relatively simple to implement it by following the tutorial.

This post is from DigiKey Technology Zone

Latest reply

CircuitPython is quite convenient, but it just doesn’t know how to write firmware.   Details Published on 2023-11-6 11:01
 
 

6822

Posts

11

Resources
2
 
Participating in more activities held by the forum will be helpful in improving and consolidating your learning.
This post is from DigiKey Technology Zone
 
 
 

6027

Posts

6

Resources
3
 

CircuitPython is quite convenient, but it just doesn’t know how to write firmware.

This post is from DigiKey Technology Zone
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
5G small base stations are under the spotlight: now is the eve of the outbreak

As we enter a period of vigorous deployment of 5G, a new industrial ecosystem is taking shape because its technical char ...

ssd1306 Chinese and picture display

This post was last edited by lemon1394 on 2021-8-17 23:19 I have found many Chinese displays of ssd1306 introduced on t ...

【Application development based on NUCLEO-F746ZG motor】5. Motor operation

This post was last edited by annysky2012 on 2021-9-11 21:34 After the hardware connection is completed and the wiring i ...

Ask Qinheng official for help whether there is a Bluetooth serial port routine for CH582

I looked at the official latest EVT version V1.2, and there is no Bluetooth serial port SPP protocol routine. Does the o ...

33 "Millions of Miles" Raspberry Pi Car——Ubuntu Remote Desktop Configuration

This post was last edited by lb8820265 on 2022-4-16 00:43 The Raspberry Pi operating system comes with VNC, which makes ...

Overall design of real-time monitoring system for home environment

introduction Home environment refers to the environment for family reunion, rest, study and housework. The quality of h ...

[HPM-DIY] openmv for hpm6750 Progress 2 (face recognition 29fps+)

Openmv for hpm has been updated by the author in the past few days, mainly fixing the following: 644525 In addition, us ...

Analog circuit power supply quality

Everyone, what is the best indicator of power quality in your conventional op amps, DACs and other analog circuits? The ...

[The 3rd Xuantie Cup RISC-V Application Innovation Competition] LicheePi 4A+004's indirect gesture recognition

This article introduces the tortuous process of implementing gesture recognition. After the program is debugged, a video ...

What is spectroscopy?

Spectroscopy is a scientific technique used to study the optical properties and chemical composition of matter. It is ba ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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