diff --git a/MCU/MCU_REAL _FINAL/MCU_1.uvproj b/MCU/MCU_REAL _FINAL/MCU_1.uvproj index 9cd484a..6e0a1ba 100644 --- a/MCU/MCU_REAL _FINAL/MCU_1.uvproj +++ b/MCU/MCU_REAL _FINAL/MCU_1.uvproj @@ -188,7 +188,7 @@ 2 0 - 2 + 1 0 0 0 diff --git a/MCU/MCU_REAL _FINAL/display.c b/MCU/MCU_REAL _FINAL/display.c index db90c6b..b3973d6 100644 --- a/MCU/MCU_REAL _FINAL/display.c +++ b/MCU/MCU_REAL _FINAL/display.c @@ -69,48 +69,7 @@ void clear() } -void miniclear() -{ - unsigned int i, j; - CSA = 1; - CSB = 0; - for(i = 0; i < 2; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x00;; - write(); - } - } - CSA = 0; - CSB = 1; - for(i = 0; i < 2; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x00; - write(); - } - } -} void displayInit() { E = 0; @@ -127,46 +86,3 @@ void displayInit() P1 = 0X3F; write(); } - -void test() -{ - unsigned int i, j; - CSA = 1; - CSB = 0; - for(i = 0; i < 8; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x55; - write(); - } - } - CSA = 0; - CSB = 1; - for(i = 0; i < 8; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x55;; - write(); - } - } -} \ No newline at end of file diff --git a/MCU/MCU_REAL _FINAL/display.h b/MCU/MCU_REAL _FINAL/display.h index 8d4b914..600f623 100644 --- a/MCU/MCU_REAL _FINAL/display.h +++ b/MCU/MCU_REAL _FINAL/display.h @@ -1,16 +1,8 @@ #ifndef _DISPLAY_H_ #define _DISPLAY_H_ -void setData(unsigned char d); -void setCommand(unsigned char d); -void lcdInit(); -void setPage(unsigned char p); -void setPage(unsigned char p); -void setLine(unsigned char p); -void setY(unsigned char p); -void test(); void displayInit(); void clear(); -void miniclear(); void write(); + #endif \ No newline at end of file diff --git a/MCU/MCU_REAL _FINAL/draw.c b/MCU/MCU_REAL _FINAL/draw.c index 5103a6d..41d00c5 100644 --- a/MCU/MCU_REAL _FINAL/draw.c +++ b/MCU/MCU_REAL _FINAL/draw.c @@ -570,4 +570,92 @@ void drawVOID8(unsigned char x,unsigned char y,unsigned char len) P1 = 0x00; write(); } +} + +void drawBEST(unsigned char x, unsigned char y) +{ + unsigned int j; + if(x < 0 || x > 127) + return; + else if(x < 64) + { + CSA = 1; + CSB = 0; + } + else + { + x = x - 63; + CSA = 0; + CSB = 1; + } + for(j = 0; j < 40; j++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + y; + write(); + P1 = 0X40 + x + j; + write(); //页y列x+j + + RS = 1; + RW = 0; + P1 = FONT_BEST0[j]; + write(); + + RS = 0; + RW = 0; + P1 = 0xb8 + y + 1; + write(); + P1 = 0X40 + x + j; + write(); //页y+1列x+j + + RS = 1; + RW = 0; + P1 = FONT_BEST1[j]; + write(); + } +} + +void drawRECORD(unsigned char x, unsigned char y) +{ + unsigned int j; + if(x < 0 || x > 127) + return; + else if(x < 64) + { + CSA = 1; + CSB = 0; + } + else + { + x = x - 63; + CSA = 0; + CSB = 1; + } + for(j = 0; j < 32; j++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + y; + write(); + P1 = 0X40 + x + j; + write(); //页y列x+j + + RS = 1; + RW = 0; + P1 =MAINMANU_PAGE4[j]; + write(); + + RS = 0; + RW = 0; + P1 = 0xb8 + y + 1; + write(); + P1 = 0X40 + x + j; + write(); //页y+1列x+j + + RS = 1; + RW = 0; + P1 = MAINMANU_PAGE5[j]; + write(); + } } \ No newline at end of file diff --git a/MCU/MCU_REAL _FINAL/img.h b/MCU/MCU_REAL _FINAL/img.h index a25541b..53f5e92 100644 --- a/MCU/MCU_REAL _FINAL/img.h +++ b/MCU/MCU_REAL _FINAL/img.h @@ -67,14 +67,14 @@ code unsigned char MAINMANU_PAGE3[]={ 0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00, 0x10,0x30,0x10,0x0F,0x88,0x48,0x21,0x11,0x0D,0x03,0x0D,0x11,0x21,0x41,0x81,0x00, }; -//第三行:弹球 +//第三行:记录 code unsigned char MAINMANU_PAGE4[]={ -0x02,0xE2,0x22,0x22,0x3E,0x00,0x00,0xF9,0x4A,0x4C,0xF8,0x4C,0x4A,0xF9,0x00,0x00, -0x04,0x84,0x84,0xFC,0x84,0x84,0x10,0x50,0x90,0x10,0xFF,0x90,0x11,0x16,0x90,0x00, +0x40,0x40,0x42,0xCC,0x00,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0xFC,0x00,0x00,0x00, +0x80,0x80,0x82,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xFE,0x80,0x80,0x80,0x00, }; code unsigned char MAINMANU_PAGE5[]={ -0x00,0x43,0x82,0x42,0x3E,0x00,0x10,0x13,0x12,0x12,0xFF,0x12,0x12,0x13,0x10,0x00, -0x20,0x60,0x20,0x1F,0x10,0x10,0x10,0x08,0x45,0x82,0x7F,0x01,0x06,0x09,0x10,0x00, +0x00,0x00,0x00,0x7F,0x20,0x10,0x00,0x3F,0x40,0x40,0x40,0x40,0x41,0x40,0x70,0x00, +0x40,0x40,0x22,0x24,0x10,0x48,0x80,0x7F,0x04,0x08,0x18,0x24,0x22,0x40,0x40,0x00, }; //第四行:关于 code unsigned char MAINMANU_PAGE6[]={ @@ -163,4 +163,13 @@ code unsigned char FONT_OVER1[]={ 0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00, 0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20, }; +//=================== 记录字库 ================== +code unsigned char FONT_BEST0[]={ +0x40,0x40,0xC0,0x5F,0x55,0x55,0xD5,0x55,0x55,0x55,0x55,0x5F,0x40,0x40,0x40,0x00, +0x04,0x04,0x04,0x04,0xF4,0x94,0x95,0x96,0x94,0x94,0xF4,0x04,0x04,0x04,0x04,0x00, +}; +code unsigned char FONT_BEST1[]={ +0x20,0x60,0x3F,0x25,0x15,0x15,0xFF,0x90,0x47,0x29,0x11,0x2D,0x43,0x80,0x80,0x00, +0x00,0xFE,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x82,0xFE,0x00,0x00, +}; #endif \ No newline at end of file