/*作者 李鹤*/ /*本程序为C51例子,可实现演示多种绘图函数、多种文字,并演示图层组合和记录绘图等多种功能*/ #include #include #include #include #define LCD_BLACK 0 #define LCD_BLUE 3 #define LCD_GREEN 28 #define LCD_CYAN 31 #define LCD_RED 224 #define LCD_MAGENTA 130 #define LCD_BROWN 168 #define LCD_DARKGRAY 73 #define LCD_GRAY 146 #define LCD_LIGHTGRAY 218 #define LCD_LIGHTBLUE 147 #define LCD_LIGHTGREEN 158 #define LCD_LIGHTCYAN 159 #define LCD_LIGHTRED 242 #define LCD_LIGHTMAGENTA 243 #define LCD_YELLOW 252 #define LCD_WHITE 255 #define mode_width 320 #define mode_height 240 #define arcdu 0.01745329 //#define INBUF_LEN 2 //数据长度 char ch_i; char strout[2]; unsigned char strin[2]; bit gnum=0,recorder=0; unsigned char len=0; bit err=0; sbit MODE=P3^3;/*PE3*/ sbit WEI=P3^4;/*PE4*/ sbit BUSY=P1^7;/*B10*/ sbit RESET=P1^0;/*reset*/ sbit SEL=P0^0;/*SELECT*/ //sbit data; sbit data_0=P2^0; sbit data_1=P2^1; sbit data_2=P2^2; sbit data_3=P2^3; sbit data_4=P2^4; sbit data_5=P2^5; sbit data_6=P2^6; sbit data_7=P2^7; code const int map_point[38][2]={{0,0},{162,151},{242,197},{289,222},{293,327},{211,284},{127,235},{117,121},{75,155},{53,196},{107,225},{85,210},{93,174},{111,161},{119,192},{104,302},{208,307},{130,269},{212,272},{132,230},{144,139},{290,313},{290,290},{218,253},{289,273},{222,238},{288,243},{262,230},{278,237},{265,260},{249,221},{234,215},{191,190},{189,182},{158,164},{142,196},{195,224},{208,199}}; code const int map_street[35][3]={{1,2,7},{2,3,7},{3,4,7},{4,5,7},{5,6,7},{7,8,7},{8,9,7},{6,9,7},{11,12,2},{8,12,2},{12,13,2},{7,13,2},{10,14,2},{14,20,2},{16,17,2},{18,19,2},{10,15,22},{1,20,7},{7,20,7},{12,14,2},{1,6,7},{2,5,7},{5,16,7},{16,17,2},{18,21,2},{22,23,2},{24,25,2},{26,27,2},{28,29,2},{30,31,2},{31,32,2},{32,33,2},{33,34,2},{25,35,2},{36,37,2}}; void demo_run(); void data_run (unsigned char num) { P2=num; }