完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
Rebuild target 'Target 1' compiling sheji.c... sheji.c(5): warning C318: can't open file 'lcd_160128.h' sheji.c(6): error C129: missing ';' before 'LCD_Initialise' sheji.c(458): warning C318: can't open file 'lcd_160128.h' Target not created 共有3处错误,标红的为有错的地方,问问各位到底要怎么改啊,求助求助 源程序: #include #include #include #include #include extern uchar LCD_Initialise(); extern uchar LCD_Write_Command(uchar cmd); extern uchar LCD_Write_Command_P1(uchar cmd,uchar paral); extern uchar LCD_Write_Command_P2(uchar cmd,uchar paral,uchar para2); extern uchar LCD_Write_Data(uchar dat); extern void Set_LCD_POS(uchar row,uchar col) reentrant; extern void Line(uchar x1,uchar y1,uchar x2,uchar y2,uchar Mode) reentrant;//以上在中断中也有用到所以定义为可重入函数 externvoid Draw_Image(uchar *G_Buffer,uchar Start_Row,uchar Start_Col)reentrant; extern void Display_Str_at_xy(uchar x,uchar y,char *Buffer,uchar wb) reentrant; extern void cls(); void Show_Score_and_Bullet() reentrant; ***it K1=P1^4; ***it K2=P1^5; ***it K3=P1^6; ***it K4=P1^7; ***it BEEP=P1^0; //开机界面绘制// code uchar const Game_Surface[]= {160,110, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, 0xFC,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x0E,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x7F,0xDF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFC,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF, 0xFC,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x1F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x03,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x7F,0xFF,0x80,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xFF, 0xFF,0xE0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x7F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x7F,0xFF,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x7F,0xFF,0xF0,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF, 0xFC,0xFF, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x0F,0xFF,0xFC,0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0xFF,0xFC,0x07,0xFF,0xF8,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0xFF,0xFF, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07, 0xFF,0xF0, 0x1F,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0xFF,0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF8,0x0F, 0xFF,0xE0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xFF, 0xFF,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x1F,0xFF,0xE0,0x3F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFC,0x0F,0xFF,0xF0,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF, 0x01,0xFF, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x0F,0xFF,0xE0,0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0xFF,0xFC,0x07,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0xFF,0xFE, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07, 0xFF,0xF0, 0x1F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x01,0xFF,0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF8,0x0F, 0xFF,0xC0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xFF, 0xFE,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x1F,0xFF,0xC0,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xF0,0x0F,0xFF,0xE0,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE, 0x01,0xFF, 0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x0F,0xFF,0xC0,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x03,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x01,0xFF,0xFE, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, 0xFF,0xE0, 0x3F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x03,0xFF,0xFC,0x07,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x83,0xFF,0xFF,0xFC,0x00,0x00, 0x00,0x00, 0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xE7,0xFF, 0xFF,0xFF, 0x07,0x80,0x00,0x00,0x00,0x03,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0xFF, 0xFF,0xFF,0xFF,0xFF,0xCF,0xC0,0x00,0x00,0x00,0x07,0xFF,0xFF,0x80,0x00, 0x00,0x00, 0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x1F, 0xFF,0xFF, 0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0, 0x00,0x00, 0x00,0x3F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE, 0x03,0xFF, 0xFF,0xE0,0x00,0x00,0x00,0x7F,0xC0,0x07,0xF8,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x3F,0xFF,0xC0,0x7F,0xFF,0xE0,0x00,0x00,0x00,0xFF,0x00,0x03,0xFC,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x0F,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x00,0x01,0xFC, 0x00,0x00, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x01,0xFF,0xFE, 0x00,0x00, 0x01,0xF8,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x9F, 0xFF,0xC0, 0x3F,0xFF,0x80,0x00,0x03,0xF0,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x1F,0x03,0xFF,0xF8,0x0F,0xFF,0xF0,0x00,0x07,0xE0,0x00,0x00,0x1F,0x80, 0x00,0x00, 0x00,0x00,0x00,0x00,0x3F,0x00,0x7F,0xFF,0x07,0xFF,0xFE,0x00,0x07,0xE0, 0x00,0x00, 0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x0F,0xFF,0xE7,0xFF, 0xFE,0x00, 0x07,0xC0,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00, 0x01,0xFF, 0xFF,0xFF,0xFE,0x00,0x0F,0xC0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00, 0x3E,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x0F,0x80,0x00,0x00,0x07,0xC0, 0x00,0x00, 0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x0F,0xFF,0xFF,0x9E,0x00,0x0F,0x80, 0x00,0x00, 0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x01,0xFF,0xFF, 0x82,0x00, 0x0F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00, 0x00,0x00, 0x3F,0xFF,0xC0,0x00,0x1F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00, 0x1F,0x00,0x00,0x00,0x0F,0xFF,0xF0,0x00,0x0F,0x00,0x00,0x00,0x07,0xC0, 0x00,0x00, 0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0xFF,0xFE,0x00,0x0F,0x80, 0x00,0x00, 0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x00,0x00,0x3F,0xFF, 0xFE,0x00, 0x0F,0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0, 0x00,0x00, 0x7F,0xFB,0xFE,0x00,0x0F,0x80,0x00,0x00,0x07,0xC0,0x03,0xFF,0xC0,0x00, 0x00,0x00, 0x07,0xF8,0x00,0x01,0xFE,0xFF,0xFE,0x00,0x07,0x80,0x00,0x00,0x07,0x80, 0x1F,0xFF, 0xF8,0x00,0x00,0x00,0x03,0xFE,0x00,0x07,0xFC,0xFF,0xFE,0x00,0x07,0xC0, 0x00,0x00, 0x0F,0x80,0x3F,0xFF,0xFC,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xF8,0xFF, 0xFE,0x00, 0x07,0xE0,0x00,0x00,0x1F,0x80,0x7F,0xFF,0xFE,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF, 0xF0,0xFF,0xFE,0x00,0x07,0xE0,0x00,0x00,0x1F,0x80,0xFF,0xFF,0xFF,0x00, 0x00,0x00, 0x00,0x3F,0xFF,0xFF,0xC0,0xFF,0xFE,0x00,0x03,0xF0,0x00,0x00,0x3F,0x01, 0xFE,0x00, 0x7F,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x00,0xFF,0xFF,0x00,0x01,0xF8, 0x00,0x00, 0x7E,0x01,0xF8,0x00,0x1F,0x00,0x00,0x00,0x00,0x03,0xFF,0xF8,0x00,0xFF, 0xFF,0x00, 0x01,0xFC,0x00,0x00,0xFE,0x01,0xF0,0x00,0x0F,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x7F,0xFF,0x80,0x00,0xFF,0x00,0x03,0xFC,0x01,0xF0,0x00,0x0F,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x7F,0xC0,0x07,0xF8,0x01, 0xF8,0x00, 0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x3F, 0xFF,0xFF, 0xF0,0x01,0xFE,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F, 0xFF,0xE0, 0x00,0x1F,0xFF,0xFF,0xE0,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x7F,0xFF,0xE0,0x00,0x07,0xFF,0xFF,0x80,0x00,0x7F,0xFF,0xFE,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF0,0x00,0x03,0xFF,0xFF,0x00,0x00, 0x3F,0xFF, 0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF8,0x00,0x00, 0x7F,0xF0, 0x00,0x00,0x1F,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F, 0xFF,0xF8, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFC,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07, 0xFF,0xFC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFC,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0F,0xF8, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x03,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x00,0x30,0x00,0x30,0xC1,0x80, 0x20,0x30, 0x00,0x21,0x80,0x00,0x0C,0xC0,0x00,0x00,0x00,0x00,0x40,0x30,0x00,0x30, 0x00,0x38, 0xC9,0x80,0x33,0xFF,0x06,0x31,0x80,0x00,0x0D,0xC0,0x00,0x00,0x00,0x01, 0xFC,0x30, 0x07,0xFF,0x00,0x06,0xC9,0x80,0x63,0xFE,0x03,0x89,0xF8,0x0F,0xCE,0x00, 0x00,0x00, 0x00,0x01,0xFB,0xF8,0x07,0xB0,0x00,0x00,0xC9,0x80,0x88,0x40,0x00,0x7E, 0x80,0x18, 0xDF,0xE0,0x00,0x00,0x00,0x01,0x8F,0x3E,0x00,0x30,0x00,0xF8,0xC9,0x81, 0xFB,0xF0, 0x08,0x35,0xF8,0x0C,0xBE,0x00,0x00,0x00,0x00,0x01,0xF9,0x30,0x3F,0xFF, 0xF8,0xC8, 0xC9,0x81,0x25,0xB0,0x0F,0x3C,0x70,0x0F,0xAC,0xC0,0x00,0x00,0x00,0x07, 0xF9,0xB0, 0x3C,0x33,0xF8,0x08,0xC9,0x80,0xCB,0xFE,0x00,0x24,0x60,0x03,0x8D,0x80, 0x00,0x00, 0x00,0x07,0xB8,0xB0,0x02,0x31,0x30,0x18,0xC9,0x81,0xF3,0x30,0x00,0x6F, 0xFE,0x03, 0x87,0x80,0x00,0x00,0x00,0x00,0xE8,0x30,0x02,0x30,0x80,0x1E,0xC9,0x80, 0x01,0xB4, 0x07,0x48,0x20,0x0E,0x47,0x00,0x00,0x00,0x00,0x03,0x88,0x30,0x06,0x30, 0x80,0x1D, 0xC9,0x80,0xFB,0xB3,0x0E,0xC8,0x20,0x3C,0x1F,0x80,0x00,0x00,0x00,0x0F, 0x58,0x70, 0x07,0xFF,0x80,0x3B,0x89,0x83,0xC6,0x31,0xC1,0x98,0x60,0x10,0xFB,0xF8, 0x00,0x00, 0x00,0x00,0x79,0xE0,0x07,0xFF,0xC0,0x37,0x09,0x82,0x19,0xF1,0x82,0x77, 0xE0,0x00, 0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 0x00,0xE0, 0x00,0x00,0xC0,0x00,0x00,0x20,0x00,0x00 }; //枪支绘制// uchar code Gun_Image[]= {24,12, 0x03,0x00,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x7F,0xFE,0xFE,0xFE,0xFE, 0xFE,0xFE, 0xFE,0xFC,0x7F,0xFE,0xFC,0x00,0x01,0xFC,0x00,0x01,0xFC,0x00,0x00,0x7F, 0x00,0x00, 0x7F,0x00,0x00,0x1F }; uchar tCount =0; uchar HCount,LCount; uchar Score =0; Bullet_Count = 20; uchar Target_x=0,Target_y=0; uchar Pre_Target_y = 0; uchar gun_y = 20; void delay(uint ms) { uchar i; while (--ms)for(i=0;i<120;i++); } void EX_INT0() interrupt 0 { if(K1==0) { if(gun_y !=0)Display_Str_at_xy(16*8,gun_y," ",0); gun_y -=8; if(gun_y < 20)gun_y = 20; Draw_Image(Gun_Image,gun_y,16); } else if(K2==0) { if(gun_y !=0) Display_Str_at_xy(16*8,gun_y," ",0); gun_y +=8; if(gun_y>100) gun_y = 100; Draw_Image(Gun_Image,gun_y,16); } else if(K3==0) { if(Bullet_Count !=0) TR1=1;else return; //弹道绘制// Line(10, gun_y +4,125,gun_y +4,1); delay(150); Line(10, gun_y +4,125,gun_y +4,0); if(Bullet_Count !=0) { Bullet_Count--; if((gun_y +4) >Target_y && (gun_y +4)
{ Score++; Pre_Target_y = Target_y; } } Show_Score_and_Bullet(); } else if(K4==0) { Score = 0;Bullet_Count = 20; Show_Score_and_Bullet(); } } void T0_INT() interrupt 1 { TH0 = -50000/256; TL0 = -50000%256; if(++tCount !=70) return; tCount = 0; if(Target_x!=0 && Target_y!=0) Display_Str_at_xy(Target_x,Target_y," ",0); Target_x = rand() %60 +8; Target_y = rand() %80+20; while ( abs(Pre_Target_y - Target_y )< 4) Target_y =rand() % 80 + 20; Display_Str_at_xy(Target_x,Target_y,"■",0); } void T1_INT () interrupt 3 { BEEP = ~BEEP; if(LCount !=0 ) { TH1 =HCount;TL1 = --LCount; } else if(--HCount !=0xFB) { TH1 = HCount;TL1 = --LCount; } else { TH1 = HCount = -420 / 256; TL1 = LCount = -420 % 256; BEEP = 1; TR1 = 0; } } void Show_Score_and_Bullet()reentrant { char dat_str[4] = {' ',0,0,0}; dat_str[1] = Score / 10+ '0'; dat_str[2] = Score % 10+ '0'; Display_Str_at_xy(37,117,dat_str,1); dat_str[1] = Bullet_Count / 10+ '0'; dat_str[2] = Bullet_Count % 10+ '0'; Display_Str_at_xy(134,117,dat_str,1); } void main() { RESET=0; RESET=1; LCD_Initialise(); cls(); Set_LCD_POS(0,0); //显示游戏封面// Draw_Image(Game_Surface,6,0); delay(5000); cls(); Display_Str_at_xy(12,1,"★★射击训练游戏★★",1); Display_Str_at_xy(2,117,"得分",0); Display_Str_at_xy(75,117,"剩余弹药:",0); Show_Score_and_Bullet(); Line (0,18,159,18,1); Line (159,18,159,112,1); Line (159,112,0,112,1); Line (0,112,0,18,1); Draw_Image(Gun_Image,gun_y,16); IE = 0x8B; IP = 0x01; IT0 = 0x01; TMOD = 0x11; TH0 = -50000/256; TL0 = -50000%256; TH1 = HCount = -420/256; TL1 = LCount = -420%256; TR0 = 1; while (1); } //---------------LCD_160128.c---------------- //LCD_160128的C文件,内含控制函数 //------------------------------------------ #include #include #include #include #include #include #include #define ASC_CHR_WIDTH 8 #define ASC_CHR_HEIGHT 12 #define HZ_CHR_HEIGHT 12 #define HZ_CHR_WIDTH 12 uchar code LCD_WIDTH = 20; uchar code LCD_HEIGHT = 128; uchar code ASC_MSK[96*12]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// ' ' 0x00,0x30,0x78,0x78,0x78,0x30,0x30,0x00,0x30,0x30,0x00,0x00,// '!' 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// '"' 0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,// '#' 0x30,0x30,0x7c,0xc0,0xc0,0x78,0x0c,0x0c,0xf8,0x30,0x30,0x00,// '$' 0x00,0x00,0x00,0xc4,0xcc,0x18,0x30,0x60,0xcc,0x8c,0x00,0x00,// '%' 0x00,0x70,0xd8,0xd8,0x70,0xfa,0xde,0xcc,0xdc,0x76,0x00,0x00,// '&' 0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// ''' 0x00,0x0c,0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x0c,0x00,0x00,// '(' 0x00,0x60,0x30,0x18,0x0c,0x0c,0x0c,0x18,0x30,0x60,0x00,0x00,// ')' 0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,// '*' 0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,// '+' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x60,0x00,// ',' 0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,// '-' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x00,0x00,// '.' 0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,// '/' 0x00,0x7c,0xc6,0xce,0xde,0xd6,0xf6,0xe6,0xc6,0x7c,0x00,0x00,// '0' 0x00,0x10,0x30,0xf0,0x30,0x30,0x30,0x30,0x30,0xfc,0x00,0x00,// '1' 0x00,0x78,0xcc,0xcc,0x0c,0x18,0x30,0x60,0xcc,0xfc,0x00,0x00,// '2' 0x00,0x78,0xcc,0x0c,0x0c,0x38,0x0c,0x0c,0xcc,0x78,0x00,0x00,// '3' 0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x1e,0x00,0x00,// '4' 0x00,0xfc,0xc0,0xc0,0xc0,0xf8,0x0c,0x0c,0xcc,0x78,0x00,0x00,// '5' 0x00,0x38,0x60,0xc0,0xc0,0xf8,0xcc,0xcc,0xcc,0x78,0x00,0x00,// '6' 0x00,0xfe,0xc6,0xc6,0x06,0x0c,0x18,0x30,0x30,0x30,0x00,0x00,// '7' 0x00,0x78,0xcc,0xcc,0xec,0x78,0xdc,0xcc,0xcc,0x78,0x00,0x00,// '8' 0x00,0x78,0xcc,0xcc,0xcc,0x7c,0x18,0x18,0x30,0x70,0x00,0x00,// '9' 0x00,0x00,0x00,0x38,0x38,0x00,0x00,0x38,0x38,0x00,0x00,0x00,// ':' 0x00,0x00,0x00,0x38,0x38,0x00,0x00,0x38,0x38,0x18,0x30,0x00,// ';' 0x00,0x0c,0x18,0x30,0x60,0xc0,0x60,0x30,0x18,0x0c,0x00,0x00,// '<' 0x00,0x00,0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,// '=' 0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,// '>' 0x00,0x78,0xcc,0x0c,0x18,0x30,0x30,0x00,0x30,0x30,0x00,0x00,// '?' 0x00,0x7c,0xc6,0xc6,0xde,0xde,0xde,0xc0,0xc0,0x7c,0x00,0x00,// '@' 0x00,0x30,0x78,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0x00,0x00,// 'A' 0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0xfc,0x00,0x00,// 'B' 0x00,0x3c,0x66,0xc6,0xc0,0xc0,0xc0,0xc6,0x66,0x3c,0x00,0x00,// 'C' 0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,// 'D' 0x00,0xfe,0x62,0x60,0x64,0x7c,0x64,0x60,0x62,0xfe,0x00,0x00,// 'E' 0x00,0xfe,0x66,0x62,0x64,0x7c,0x64,0x60,0x60,0xf0,0x00,0x00,// 'F' 0x00,0x3c,0x66,0xc6,0xc0,0xc0,0xce,0xc6,0x66,0x3e,0x00,0x00,// 'G' 0x00,0xcc,0xcc,0xcc,0xcc,0xfc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,// 'H' 0x00,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,// 'I' 0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,// 'J' 0x00,0xe6,0x66,0x6c,0x6c,0x78,0x6c,0x6c,0x66,0xe6,0x00,0x00,// 'K' 0x00,0xf0,0x60,0x60,0x60,0x60,0x62,0x66,0x66,0xfe,0x00,0x00,// 'L' 0x00,0xc6,0xee,0xfe,0xfe,0xd6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,// 'M' 0x00,0xc6,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0x00,0x00,// 'N' 0x00,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x00,0x00,// 'O' 0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0xf0,0x00,0x00,// 'P' 0x00,0x38,0x6c,0xc6,0xc6,0xc6,0xce,0xde,0x7c,0x0c,0x1e,0x00,// 'Q' 0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0xe6,0x00,0x00,// 'R' 0x00,0x78,0xcc,0xcc,0xc0,0x70,0x18,0xcc,0xcc,0x78,0x00,0x00,// 'S' 0x00,0xfc,0xb4,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,// 'T' 0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,// 'U' 0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00,// 'V' 0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xd6,0x6c,0x6c,0x6c,0x00,0x00,// 'W' 0x00,0xcc,0xcc,0xcc,0x78,0x30,0x78,0xcc,0xcc,0xcc,0x00,0x00,// 'X' 0x00,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x30,0x30,0x78,0x00,0x00,// 'Y' 0x00,0xfe,0xce,0x98,0x18,0x30,0x60,0x62,0xc6,0xfe,0x00,0x00,// 'Z' 0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,// '[' 0x00,0x00,0x80,0xc0,0x60,0x30,0x18,0x0c,0x06,0x02,0x00,0x00,// '' 0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,// ']' 0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// '^' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,// '_' 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// '`' 0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0x76,0x00,0x00,// 'a' 0x00,0xe0,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0xdc,0x00,0x00,// 'b' 0x00,0x00,0x00,0x00,0x78,0xcc,0xc0,0xc0,0xcc,0x78,0x00,0x00,// 'c' 0x00,0x1c,0x0c,0x0c,0x7c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,// 'd' 0x00,0x00,0x00,0x00,0x78,0xcc,0xfc,0xc0,0xcc,0x78,0x00,0x00,// 'e' 0x00,0x38,0x6c,0x60,0x60,0xf8,0x60,0x60,0x60,0xf0,0x00,0x00,// 'f' 0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,// 'g' 0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0xe6,0x00,0x00,// 'h' 0x00,0x18,0x18,0x00,0x78,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,// 'i' 0x00,0x0c,0x0c,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0x78,// 'j' 0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x6c,0x66,0xe6,0x00,0x00,// 'k' 0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,// 'l' 0x00,0x00,0x00,0x00,0xfc,0xd6,0xd6,0xd6,0xd6,0xc6,0x00,0x00,// 'm' 0x00,0x00,0x00,0x00,0xf8,0xcc,0xcc,0xcc,0xcc,0xcc,0x00,0x00,// 'n' 0x00,0x00,0x00,0x00,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,// 'o' 0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x7c,0x60,0xf0,// 'p' 0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x1e,// 'q' 0x00,0x00,0x00,0x00,0xec,0x6e,0x76,0x60,0x60,0xf0,0x00,0x00,// 'r' 0x00,0x00,0x00,0x00,0x78,0xcc,0x60,0x18,0xcc,0x78,0x00,0x00,// 's' 0x00,0x00,0x20,0x60,0xfc,0x60,0x60,0x60,0x6c,0x38,0x00,0x00,// 't' 0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,// 'u' 0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0x78,0x30,0x00,0x00,// 'v' 0x00,0x00,0x00,0x00,0xc6,0xc6,0xd6,0xd6,0x6c,0x6c,0x00,0x00,// 'w' 0x00,0x00,0x00,0x00,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0x00,0x00,// 'x' 0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3c,0x0c,0x18,0xf0,// 'y' 0x00,0x00,0x00,0x00,0xfc,0x8c,0x18,0x60,0xc4,0xfc,0x00,0x00,// 'z' 0x00,0x1c,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x1c,0x00,0x00,// '{' 0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,0x00,// '|' 0x00,0xe0,0x30,0x30,0x18,0x0c,0x18,0x30,0x30,0xe0,0x00,0x00,// '}' 0x00,0x73,0xda,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// '~' }; uchar gCurRow, gCurCol; uchar tCurRow, tCurCol; uchar ShowModeSW; uint txthome,grhome; //uchar GetRow(); //uchar GetCol(); uchar Status_BIT_01(); // 状态位STA1,STA0判断(读写指令和读写数据) uchar Status_BIT_3(); // 状态位ST3判断(数据自动写状态) uchar LCD_Write_Command_P2(uchar cmd,uchar para1,uchar para2); // 写双参数的指令 uchar LCD_Write_Command_P1(uchar cmd,uchar Para1); // 写单参数的指令 uchar LCD_Write_Command(uchar cmd); // 写无参数的指令 uchar LCD_Write_Data(uchar dat); // 写数据 uchar LCD_Read_Data(); // 读数据 void Set_LCD_POS(uchar row, uchar col) reentrant; // 设置当前地址 //void cursor(uchar uRow, uchar uCol); //设置当前显示行、列 //void at(unsigned char x,unsigned char y);/*设定文本x,y值*/ void cls(); // 清屏 uchar LCD_Initialise(); // LCM 初始化 //void charout(uchar *str); //ASCII(8*8) 显示函数 uchar Display_Str_at_xy(uchar x,uchar y,char *fmt) reentrant;// ASCII(8*16) 及汉字(16*16) 显数 void OutToLCD(uchar Dat,uchar x,uchar y);//显示辅助函数 //void SetShowMode(uchar newShowModeSW); void Line( unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, uchar Mode) reentrant; void Pixel(unsigned char PointX,unsigned char PointY, uchar Mode); /*uchar fnGetRow(void) { return gCurRow; } uchar fnGetCol(void) { return gCurCol; } */ typedef struct typFNT_GB16 // 汉字字模显示数据结构 { char Index[2]; char Msk[24]; }; struct typFNT_GB16 code GB_16[]={ "得",0x27,0xc0,0x24,0x40,0x57,0xc0,0x94,0x40,0x27,0xc0,0x60,0x00, 0xAF,0xE0,0x20,0x80,0x2F,0xE0,0x24,0x80,0x21,0x80,0x00,0x00, "分",0x11,0x00,0x11,0x00,0x20,0x80,0x20,0x80,0x40,0x40,0xBF,0xA0, 0x08,0x80,0x08,0x80,0x10,0x80,0x20,0x80,0xC7,0x00,0x00,0x00, /*-- 文字: ★--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*--宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "★",0x04,0x00,0x04,0x00,0x0E,0x00,0x0E,0x00,0xFF,0xE0,0x7F,0xC0, 0x1F,0x00,0x1F,0x00,0x3B,0x80,0x20,0x80,0x40,0x40,0x00,0x00, /*-- 文字: ■--* / /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "■",0x00,0x00,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0, 0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x7F,0xC0,0x00,0x00,0x00,0x00, /*-- 文字: 射--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "射",0x20,0x40,0x78,0x40,0x48,0x40,0x7F,0xE0,0x48,0x40,0x7A,0x40, 0x49,0x40,0xF9,0x40,0x28,0x40,0x48,0x40,0x99,0xC0,0x00,0x00, /*-- 文字: 击--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "击",0x04,0x00,0x04,0x00,0x7F,0xC0,0x04,0x00,0x04,0x00,0xFF,0xE0, 0x04,0x00,0x44,0x40,0x44,0x40,0x44,0x40,0x7F,0xC0,0x00,0x00, /*-- 文字: 训--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "训",0x44,0x40,0x25,0x40,0x05,0x40,0x05,0x40,0xC5,0x40,0x45,0x40, 0x45,0x40,0x45,0x40,0x55,0x40,0x68,0x40,0x10,0x40,0x00,0x00, /*-- 文字: 练--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "练",0x22,0x00,0x4F,0xE0,0x42,0x00,0x9F,0x80,0xE4,0x80,0x44,0x80, 0xAF,0xE0,0xC0,0x80,0x34,0xC0,0xC8,0xA0,0x13,0xA0,0x00,0x00, /*-- 文字: 游--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "游",0x91,0x00,0x49,0xE0,0x3E,0x00,0x93,0xE0,0x5C,0x40,0x54,0x80, 0x55,0xE0,0x94,0x80,0x94,0x80,0xA4,0x80,0x4D,0x80,0x00,0x00, /*-- 文字: 戏--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "戏",0x02,0x80,0xF2,0x40,0x12,0x40,0x13,0xE0,0x9E,0x00,0x52,0x40, 0x22,0x80,0x31,0x00,0x49,0x20,0x42,0xA0,0x8C,0x60,0x00,0x00, /*-- 文字: 剩--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "剩",0x7C,0x20,0x10,0xA0,0xFE,0xA0,0x54,0xA0,0xD6,0xA0,0x54,0xA0, 0xD6,0xA0,0x38,0xA0,0x54,0xA0,0x92,0x20,0x10,0xE0,0x00,0x00, /*-- 文字: 余--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "余",0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0xDF,0x60,0x04,0x00, 0x7F,0xC0,0x15,0x00,0x24,0x80,0x44,0x40,0x9C,0x40,0x00,0x00, /*-- 文字: 弹--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "弹",0x04,0x40,0xE2,0x80,0x2F,0xC0,0x29,0x40,0xEF,0xC0,0x89,0x40, 0xEF,0xC0,0x21,0x00,0x3F,0xE0,0x21,0x00,0xC1,0x00,0x00,0x00, /*-- 文字: 药--*/ /*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=16x12 --*/ "药",0x11,0x00,0xFF,0xE0,0x11,0x00,0x22,0x00,0x4B,0xE0,0x74,0x20, 0x22,0x20,0x59,0x20,0x61,0x20,0x18,0x40,0xE1,0xC0,0x00,0x00, }; uchar Status_BIT_01(void) // 状态位STA1,STA0判断(读写指令和读写数据) { uchar i; for(i=5;i>0;i--) { if((LCMCW & 0x03) == 0x03) break; } return i; // 若返回零,说明错误 } uchar Status_BIT_3(void) // 状态位ST3判断(数据自动写状态) { uchar i; for(i=5;i>0;i--) { if((LCMCW & 0x08) == 0x08) break; } return i; // 若返回零,说明错误 } uchar LCD_Write_Command_P2(uchar cmd,uchar para1,uchar para2) // 写双参数的指令 { if(Status_BIT_01() == 0) return 1; LCMDW = para1; if(Status_BIT_01() == 0) return 2; LCMDW = para2; if(Status_BIT_01() == 0) return 3; LCMCW = cmd; return 0; // 返回0成功 } uchar LCD_Write_Command_P1(uchar cmd,uchar para1) // 写单参数的指令 { if(Status_BIT_01() == 0) return 1; LCMDW = para1; if(Status_BIT_01() == 0) return 2; LCMCW = cmd; return 0; // 返回0成功 } uchar LCD_Write_Command(uchar cmd) // 写无参数的指令 { if(Status_BIT_01() == 0) return 1; LCMCW = cmd; return 0; // 返回0成功 } uchar LCD_Write_Data(uchar dat) // 写数据 { if(Status_BIT_3() == 0) return 1; LCMDW = dat; return 0; // 返回0成功 } uchar LCD_Read_Data() // 读数据 { if(Status_BIT_01() == 0) return 1; return LCMDW; } void Set_LCD_Pos(uchar row, uchar col) reentrant//设置当前地址 { uint Pos; Pos = row * LCD_WIDTH+ col; LCD_Write_Command_P2(LC_ADD_POS,Pos % 256,Pos / 256); //修改 gCurRow = row; gCurCol = col; } //清屏 void cls(void) { uint i; LCD_Write_Command_P2(LC_ADD_POS,0x00,0x00); // 置地址指针 LCD_Write_Command(LC_AUT_WR); // 自动写 for(i=0;i<0x2000;i++) { Status_BIT_3(); LCD_Write_Data(0x00); // 写数据 } LCD_Write_Command(LC_AUT_OVR); // 自动写结束 LCD_Write_Command_P2(LC_ADD_POS,0x00,0x00); // 重置地址指针 gCurRow = 0; // 置地址指针存储变量 gCurCol = 0; } // LCM 初始化 uchar LCD_Initialise() {
|
|
相关推荐
1个回答
|
|
这个一般是头文件的路径没有包含进去!
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-使用AHT20进行环境监测之AHT20传感器介绍
828 浏览 0 评论
824 浏览 0 评论
861 浏览 1 评论
基于瑞萨FPB-RA4E2智能床头灯项目——1编译环境搭建与点亮驱动ws2812全彩LED
836 浏览 0 评论
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-LCD显示图片编程示例之介绍mmap
1292 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11820 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 06:53 , Processed in 0.547312 second(s), Total 72, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号