Today I tried to store the array in flash and then read it out, and I made some modifications to the original 5110 project. Can you tell where I changed it?
uint8 Chinese_Font[][25]PROGMEM = { /*-- Text: 兀 --*/ /*-- Kaiti 9; The corresponding dot matrix under this font is: width x height = 12x12 --*/ /*-- The height is not a multiple of 8, now adjusted to: width x height = 12x16 --*/ { 0x00,0x48,0x48,0xDE,0xFE,0xF4,0xFE,0x76,0x24,0x04,0x04,0x00,0x00,0x02,0x03,0x03, 0x01,0x03,0x03,0x02,0x02,0x02,0x03,0x00 }, //Omit other definitions
Two files need to be modified:
/****************************************************** ********** ** Name: void LCD_Write_Char(uint8 c) ** Function: Write a character ** Input parameter: c character to be written ** Export parameters: None ** Instructions for use: None *************************************************** **********/ void LCD_Write_Char(uint8 c) { uint8 line = 0; c -= 32; for (line = 0; line < 6; line++) { LCD_Write_Byte(pgm_read_byte(&ASSIC_Font[c][line]), 1); } }
/****************************************************** ********** ** Name: void LCD_Write_Chinese_String(uint8 X, uint8 Y,uint8 ch_with, ** uint8 num,uint8 s[][],uint8 line,uint8 row) ** Function: Write Chinese sentences to the specified coordinates ** Input parameters: X, Y coordinates of settings ** ch_with The width of Chinese characters ** num The number of Chinese characters ** s array ** line starts from which line ** row The width between words ** Export parameters: None ** Instructions for use: None *************************************************** **********/ void LCD_Write_Chinese_String(uint8 X, uint8 Y,uint8 ch_with, uint8 num,uint8 s[][],uint8 line,uint8 row) { uint8 i = 0; uint8 n = 0; uint8 (*catch)[25] = s; LCD_Set_XY(X,Y); /*Write string*/ for (i = 0;i < num;) { for (n = 0; n < ch_with * 2; n++) { if (n == ch_with) { if (i == 0) { LCD_Set_XY(X,Y + 1); } else { LCD_Set_XY((X + (ch_with + row) *i),Y + 1); } } //Read data from flash LCD_Write_Byte(pgm_read_byte(&catch[line + i][n] ),1); } i++; LCD_Set_XY((X + (ch_with + row) * i),Y); } }
Previous article:IAR defines variables into registers "__regvar"
Next article:Use of atmega8 Flash
Recommended ReadingLatest update time:2024-11-24 19:54
- Popular Resources
- Popular amplifiers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
- Introduction and practice of robot Python geek programming
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- CATL releases October battle report
- Battery industry in October 2024: growth momentum remains unabated!
- Mercedes-Benz will launch the eCitaro equipped with NMC4 batteries to provide high energy density and long life
- Many companies have announced progress on solid-state batteries. When will solid-state batteries go into mass production?
- Xsens Sirius Series Inertial Sensors Enable 3D Inertial Navigation in Harsh Environments
- Infineon's Automotive Landscape: From Hardware to Systems
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The difference between radio remote control and infrared remote control
- RL78 Chip Selection Manual
- Fieldbus-based frequency conversion drive system for paper machines
- MSP430 infrared remote control design
- AT32F425-Evaluation Report-Flash Read and Write 07
- ShineBlink ultra-low-code IoT chip App remotely controls relays to connect to Gizwits Cloud
- Essential for getting started! STM32 IoT practical tutorial
- 【TI Recommended Course】#TI.com Online Purchasing Special: Smart Buildings#
- ADI [Hybrid Electric Vehicle (HEV)/Electric Vehicle (EV)] Lithium Battery Management Solutions
- Computer peripherals expert - Jinhetian mobile hard disk enclosure