汉字取模部分代码
unsigned char huan[] =
{
0x04, 0x24, 0x44, 0x84, 0x64, 0x9C, 0x40, 0x30, 0x0F, 0xC8, 0x08, 0x08, 0x28, 0x18, 0x00, 0x00,
0x10, 0x08, 0x06, 0x01, 0x82, 0x4C, 0x20, 0x18, 0x06, 0x01, 0x06, 0x18, 0x20, 0x40, 0x80, 0x00
};/*"欢",0*/
unsigned char ying[] =
{
0x40, 0x40, 0x42, 0xCC, 0x00, 0x00, 0xFC, 0x04, 0x02, 0x00, 0xFC, 0x04, 0x04, 0xFC, 0x00, 0x00,
0x00, 0x40, 0x20, 0x1F, 0x20, 0x40, 0x4F, 0x44, 0x42, 0x40, 0x7F, 0x42, 0x44, 0x43, 0x40, 0x00
};/*"迎",1*/
unsigned char shi[] =
{
0x80, 0x60, 0xF8, 0x07, 0x04, 0xE4, 0x24, 0x24, 0x24, 0xFF, 0x24, 0x24, 0x24, 0xE4, 0x04, 0x00,
0x00, 0x00, 0xFF, 0x00, 0x80, 0x81, 0x45, 0x29, 0x11, 0x2F, 0x41, 0x41, 0x81, 0x81, 0x80, 0x00
};/*"使",0*/
unsigned char yong[] =
{
0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0xFE, 0x22, 0x22, 0x22, 0x22, 0xFE, 0x00, 0x00, 0x00,
0x80, 0x60, 0x1F, 0x02, 0x02, 0x02, 0x02, 0x7F, 0x02, 0x02, 0x42, 0x82, 0x7F, 0x00, 0x00, 0x00
};/*"用",1*/
主函数部分代码
int main(void)
{
u8 t;
u8 *temp;
u16 SET_VOLTAGE = 123;
SystemInit ();
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
delay_init(); //延时初始化
LCD_IO_init(); //显示屏IO初始化
Lcd_Init(); //显示屏寄存器初始化
LCD_Clear(); //显示屏清屏操作
uart_init(9600); //波特率使用115200
printf("欢迎使用\r\n");
while(1)
{
display_graphic_16x16(3, 16, 0, huan);
display_graphic_16x16(3, 32, 0, ying);
display_graphic_16x16(3, 48, 0, shi);
display_graphic_16x16(3, 64, 0, yong);
}
}
|