ATmega8 routine: Flash 5110

Source: Internet
Author: User

Today, I try to save the array to flash, read it again, and modify it on the original 5110 project. Can you tell where I changed it?

 

 

Uint8 chinese_font [] [25] progmem =
{
/* -- Text: Wu --*/
/* -- 9 9; the dot matrix corresponding to this font is: width x Height = 12x12 --*/
/* -- The height is not a multiple of 8, and is adjusted to: width x Height = 12x16 --*/
{
0 x, 0 x, 0x48, 0xde, 0xfe, 0xf4, 0xfe, 0 x, 0x24, 0 x, 0 x, 0 x, 0 X,
0x01,0x03,0x03,0x02,0x02,0x02,0x03,0x00
},

// Omit other definitions


Two files to be modified:

/*************************************** ********************
** Name: void LCD _write_char (uint8 C)
** Power: Write a character
** Entry parameter: the character to be written by C.
** Exit parameter: None
** Usage instructions: 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 specified coordinates
** Entry parameters: Coordinates set by X and Y
** Ch_with the width of Chinese Characters
** Number of num Chinese Characters
** S Array
** Line starts from the first line
** The width between the row and the word
** Exit parameter: None
** Usage instructions: 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 a 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 );
}
}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.