Blue Bridge Cup embedded ninth tournament title used in the highlights, mainly by
void LCD_DisplayChar(u8 Line, u16 Column, u8 Ascii);
to complete the function that is suddenly no longer operate the line, but all of a sudden just to manipulate a character, ASCII code parameter is passed , three parameters were inlet: ASCII code row, column, data.
Look at the specific operation:
1, direct display of a character:
LCD_SetTextColor(Red);
LCD_DisplayChar(Line4, 319-176, 'A');
The first parameter is the fourth row, the second parameter is the number of columns, a total of 319 since the LCD, if the column is set to 0, then it is displayed from the right, looking for the convenience, I use the 319-176, It indicates that I want the red "a" in the display section 176 of the left.
2, the display in a variable:
dat1 = THH / 10;
dat2 = THH % 10;
LCD_SetTextColor(Red);
LCD_DisplayChar(Line4, 319-97, dat1+'0');
LCD_DisplayChar(Line4, 319-113, dat2+'0');
LCD_DisplayChar(Line4, 319-128, ':');
Because the LCD_DisplayChar()
function can only manipulate a character, so if you want to highlight is greater than or equal to 2 digits of the time, we need to be a bit isolated, ten, etc., and then separately for every show, Although some trouble, but did so only temporarily.
Since the LCD_DisplayChar()
function parameter is passed in the form of ASCII code, so the display variable, also need to ASCII code conversion, either plus 0x30
or directly coupled '0'
.