496 views|4 replies

280

Posts

7

Resources
The OP
 

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

 

1. There is a problem with the experimental board

I was very happy when I first received the experimental board. After unpacking and checking, everything was normal as shown in the following picture.

Figure 1: Unboxing

But the power-on is abnormal, the screen has only backlight, no display, as shown in the following figure.

Figure 2: No display

I thought the firmware was not flashed properly or lost after testing, so I searched the official website for various factory reset files and flashed them. The files were all flashed, and the USB port display was normal, but it just didn't display. I basically determined that there was something wrong with the screen. Then I contacted Dejie to exchange it, but the reply I got was that it would take until October or later, and the specific time was not yet determined, so it was recommended to return the product.

I thought I would miss this event, but by chance I pressed the bottom of the screen with my finger and it actually displayed text. It seems that the screen is not broken, but most likely it is not soldered properly. I carefully lifted the screen and re-soldered the FPC pads one by one, as shown in the following figure.

Figure 3. Welding screen FPC

Then power on again, and it shows normal display, and the previously flashed programs can work normally, as shown in the figure below.

Figure 4: The screen can display

Unexpectedly, it was fixed with just a little welding. It was like a light bulb turning into a silver lining. I can now carry out the board task.

2. Display Chinese

CircuitPython itself can only display English characters, without a Chinese character library. To display Chinese characters, you need to use a custom library. By studying the relevant documents of CircuitPython, you can use the Bitmap character library to call a custom Chinese character library to achieve Chinese display.

The corresponding library is: adafruit_bitmap_font

Since the font library in PCF format runs faster, I directly copied the ready-made font library shared by the big guys in the group.

CircuitPython programming is basically just about understanding the calls to each library used, which is relatively simple. The following code implements switching between fonts and displaying two fonts, while the backlight gradually changes from dark to bright.

Code

import board
import digitalio
import time

from adafruit_display_text import label
from adafruit_bitmap_font  import bitmap_font

display = board.DISPLAY
board.DISPLAY.brightness = 0.5
board.DISPLAY.rotation = 0

str_disp = "恭喜发财!"

font = bitmap_font.load_font("opposans_m_12.pcf")
color = 0xE60000

text_area = label.Label(font, text=str_disp, color=color)
text_area.x = 93
text_area.y = 62

display.show(text_area)

font_cs = 0

while True:
    # Fade up the backlight
    for i in range(100):
        board.DISPLAY.brightness = 0.01 * i
        time.sleep(0.01)
    if(font_cs == 0):
        font_cs = 1
        font = bitmap_font.load_font("sanjiruosixingkai_m_16.pcf")
    else:
        font_cs = 0
        font = bitmap_font.load_font("opposans_m_12.pcf")
    text_area = label.Label(font, text=str_disp, color=color)
    text_area.x = 88
    text_area.y = 62
    display.show(text_area)
    
    

The effect after running is as shown in the video below.

005


This post is from DigiKey Technology Zone

Latest reply

Unexpectedly, it was fixed with just a little welding. It was like a light bulb turning into a silver lining. I can now carry out the board task. The boss has a talent for repairs!   Details Published on 2023-9-5 09:54
 
 

623

Posts

0

Resources
2
 

The tricks used by merchants nowadays are very obvious!

This delay not only made money, but also saved maintenance costs.

What is CircuitPython?

This post is from DigiKey Technology Zone

Comments

This activity recommends using CircuitPython programming  Details Published on 2023-8-31 11:01
This activity recommends using CircuitPython programming  Details Published on 2023-8-31 10:44
 
 
 

280

Posts

7

Resources
3
 
jobszheng5 posted on 2023-8-31 09:43 The tricks of the merchants are very obvious now! This delay not only makes money, but also saves maintenance costs. By the way: CircuitPython ...

This activity recommends using CircuitPython programming

This post is from DigiKey Technology Zone
 
 
 

17

Posts

2

Resources
4
 
jobszheng5 posted on 2023-8-31 09:43 The tricks of the merchants are very obvious now! This delay not only makes money, but also saves maintenance costs. By the way: CircuitPython ...

You can understand it as a variant of MicroPython

This post is from DigiKey Technology Zone
 
 
 

6824

Posts

11

Resources
5
 

Unexpectedly, it was fixed with just a little welding. It was like a light bulb turning into a silver lining. I can now carry out the board task.

The boss has a talent for repairs!

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
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