newlandmark

Ink screen TF card e-book source code open source

 
Overview

I bought a 4.2-inch ink screen on Xianyu for more than ten yuan and made an exclusive e-book as a gift for a friend who likes writing.

In the previous video messages, many friends used the internal FLASH for storage and there was too little, so I made this version with a TF card.

When I started working on this project, I originally planned to buy some txt reading code from other bloggers, but after searching around, I found that all the similar projects I could find only had firmware and no open source source code, which was very embarrassing.

I had to do some research myself, and it was actually very simple.

The main thing is to understand the characteristics of UTF-8 encoding. The 0xB0 to 0xF7 encoding is Chinese characters. One character occupies three bytes. The other characters are English characters, and one character occupies one byte.

According to this rule, it is ok to create indexes and read characters, and then control line wrapping and page turning according to the screen size and font size.

The screen that the director used was bought from Xiaohuangyao https://m.tb.cn/h.fqbYFvA?tk=89O92SqRhIO . It has the same driver as Wei Xue’s 4.2-inch screen, but the cable placement and direction are different.

The code uses the GxEPD2 library driver, and the Arduino IDE library management can be downloaded directly.

The three-color 4.2-inch ink screen uses a black and white screen driver, so the refresh speed will be relatively faster.

The TF card tested was a 32G card. In fact, a 1G or 2G card is enough, no matter how big it is.

The file was tested on a 13MB TXT file. It takes a few minutes to create the index file. Larger files will take longer to create the index file.

I haven't had time to make the shell yet, but it feels like it would be very cool to run naked like this.

One of the flying wires in the picture has been modified. There may still be bugs, please give me more advice, but they may not be corrected, hahaha.

The text must be UTF-8 encoded and the file name is txt.txt before it can be read by the program. When updating the file, you need to delete the SY.TXT file to recreate the index file.

Video introduction viewing address

https://www.ixigua.com/7084521156958487047?logTag=4771fd83136a44e8c6c7

 

 

 

 

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-07 16:40:34

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号