#2
小焦叔叔2021-01-19 23:19
|
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
#3
小焦叔叔2021-01-19 23:22
以前我发现是没有定义外部变量,但是这次定义了也不行
|
#4
小焦叔叔2021-01-23 14:47
这是新的,
重新修改过的: 全部是提示:“不坚决外部变量***”、“提及不坚决外部变量***”,怎么解决? FILE_1:TYPE.H #ifndef _TYPE_H #define _TYPE_H #include"STC15.H" #define AT24C1024 0x50 #define EEPROM_0 0 #define EEPROM_1 1 #define A1 0x00 #define p0_0 0x00 #define p0_1 0x01 #define R 1 #define W 0 sbit SDA_0=P0^0; sbit SDA_1=P0^2; sbit SCL=P0^1; sbit RST=P3^2; sbit RS=P4^1; sbit RW=P4^2; sbit E=P4^4; sbit CS1=P4^5; sbit CS2=P3^4; sbit CS3=P3^3; sbit buzz=P3^7; struct key_code { unsigned char key_str[9]; unsigned int key_val; unsigned char lett; unsigned int py_start; unsigned char py_num; unsigned char key_order; }; struct byte { unsigned int byte[12]; }; struct pinyin { unsigned char pinyin_str[9]; unsigned int off_start; unsigned int off_end; }; struct addr { unsigned long addr; unsigned int order; }; struct text_buf { unsigned char text_buf[24]; }; #endif FILE_2:DADA.H #ifndef _DATA_H #define _DATA_H #include"TYPE.H" extern struct key_code code key_code[4][12]; extern unsigned char code letter_s[26*12]; extern struct pinyin code pinyin[400]; extern unsigned char code number_tab[10*12]; extern unsigned char code dot[12]; #endif FILE_3:DATA.C #include"DATA.H" struct key_code code key_code[4][12]= { { {"h",0,7,104,19,1}, {"i",525,8,0,0,2}, {"j",695,9,124,15,3}, {"k",781,10,139,11,4}, {"l",832,11,150,25,5}, {"m",867,12,175,20,6}, {"n",892,13,195,24,7}, {"6",910,255,0,0,8}, {"7",924,255,0,0,9}, {"8",936,255,0,0,10}, {"9",945,255,0,0,11}, {"0",953,255,0,0,12} }, { {"a",0,0,0,5,13}, {"b",525,1,5,17,14}, {"c",695,2,22,27,15}, {"d",781,3,49,21,16}, {"e",832,4,71,3,17}, {"f",867,5,74,9,18}, {"g",892,6,84,20,19}, {"1",910,255,0,0,20}, {"2",924,255,0,0,21}, {"3",936,255,0,0,22}, {"4",945,255,0,0,23}, {"5",953,255,0,0,24} }, { {"o",0,14,219,2,25}, {"p",525,15,221,18,26}, {"q",695,16,239,11,27}, {"r",781,17,250,15,28}, {"s",832,18,265,36,29}, {"t",867,19,301,20,30}, {"C/E",892,255,0,0,31}, {"+/(",910,255,0,0,32}, {"-/)",924,255,0,0,33}, {"*/$",936,255,0,0,34}, {"/\"",945,255,0,0,35}, {"./=",953,255,0,0,36} }, { {"u",0,20,0,0,37}, {"v",525,21,0,0,38}, {"w",695,22,321,10,39}, {"x",781,23,331,15,40}, {"y",832,24,346,16,41}, {"z",867,25,362,38,42}, {"MU",892,255,0,0,43}, {"MD",910,255,0,0,44}, {"ML",924,255,0,0,45}, {"MR",936,255,0,0,46}, {"SPA/CLR",945,255,0,0,47}, {"ENT/SAVE",953,255,0,0,48} } }; unsigned char code letter_s[26*12]= { /*a*/ 0x00,0x00,0x00,0x00,0x80,0x00,0x1E,0x11,0x11,0x11,0x0F,0x10, /*b*/ 0xF0,0x00,0x00,0x00,0x00,0x00,0x1F,0x11,0x11,0x11,0x0E,0x00, /*c*/ 0x00,0x80,0x80,0x80,0x00,0x00,0x0F,0x10,0x10,0x10,0x09,0x00, /*d*/ 0x00,0x00,0x00,0x00,0xF0,0x00,0x0E,0x11,0x11,0x11,0x1F,0x10, /*e*/ 0x00,0x80,0x80,0x80,0x00,0x00,0x0F,0x12,0x12,0x12,0x0B,0x00, /*f*/ 0x80,0x80,0xE0,0x90,0x90,0x00,0x00,0x00,0x1F,0x00,0x00,0x00, /*g*/ 0x00,0x80,0x80,0x80,0x80,0x80,0x8F,0x88,0x88,0x88,0x7F,0x00, /*h*/ 0xF0,0x00,0x00,0x00,0x00,0x00,0x1F,0x01,0x01,0x01,0x1E,0x00, /*i*/ 0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x1F,0x10,0x00,0x00, /*j*/ 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x81,0x81,0x7F,0x00,0x00, /*k*/ 0xF0,0x00,0x00,0x80,0x40,0x00,0x1F,0x02,0x05,0x08,0x10,0x00, /*l*/ 0x00,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x00,0x00, /*m*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x01,0x1F,0x01,0x1E,0x00, /*n*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x01,0x01,0x01,0x1E,0x00, /*o*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x11,0x11,0x11,0x0E,0x00, /*p*/ 0xC0,0x80,0x80,0x80,0x00,0x00,0xFF,0x08,0x08,0x08,0x07,0x00, /*q*/ 0x00,0x00,0x00,0x00,0x80,0x00,0x0E,0x11,0x11,0x11,0xFF,0x00, /*r*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x02,0x01,0x00, /*s*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x15,0x15,0x09,0x00,0x00, /*t*/ 0x00,0x00,0xC0,0x00,0x00,0x00,0x01,0x01,0x0F,0x11,0x09,0x00, /*u*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10,0x10,0x1F,0x10,0x00, /*v*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x10,0x0F,0x00,0x00, /*w*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x1E,0x10,0x0F,0x00, /*x*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x0A,0x04,0x0A,0x11,0x00, /*y*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x8F,0x90,0x90,0x7F,0x00, /*z*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x19,0x15,0x13,0x09,0x00 }; struct pinyin code pinyin[400]= { /********************1*******************/ {"a",1601,1636}, //a 0 a0 {"ai",1603,1615}, {"an",1616,1627}, {"ang",1625,1627}, {"ao",1628,1636}, {"b",1637,1832}, //b 5 {"ba",1637,1712}, {"bai",1655,1662}, {"ban",1663,1689}, {"bang",1678,1689}, /********************11*******************/ {"bao",1690,1712}, //a10 {"bei",1713,1727}, {"ben",1728,1737}, {"beng",1732,1737}, {"bi",1738,1802}, {"bian",1762,1773}, {"biao",1774,1777}, {"bie",1778,1781}, {"bin",1782,1802}, {"bing",1788,1802}, /********************21*******************/ {"bo",1803,1821}, //a20 {"bu",1822,1832}, {"c",1833,2077}, //c 22 {"ca",1833,1920}, {"cai",1834,1844}, {"can",1845,1865}, {"cang",1852,1856}, {"cao",1857,1861}, {"ce",1862,1868}, {"ceng",1867,1868}, /********************31*******************/ {"ch",1869,2034}, //a30 {"cha",1869,1920}, {"chai",1880,1882}, {"chan",1883,1911}, {"chang",1893,1911}, {"chao",1912,1920}, {"che",1921,1951}, {"chen",1927,1951}, {"cheng",1937,1951}, {"chi",1952,1967}, /********************41*******************/ {"chon",1968,1972}, //a40 {"chou",1973,1984}, {"chu",1985,2034}, {"chuai",2007,2007}, {"chuan",2008,2020}, {"chuang",2015,2020}, {"chui",2021,2025}, {"chun",2026,2032}, {"chuo",2033,2034}, {"d",2078,2273}, //d 49 /********************51*******************/ {"da",2078,2133}, //a50 {"dai",2084,2101}, {"dan",2102,2121}, {"dang",2117,2121}, {"dao",2122,2133}, {"de",2134,2143}, {"dei",2135,2135}, {"deng",2137,2143}, {"di",2144,2210}, {"dian",2163,2178}, /********************61*******************/ {"diao",2179,2187}, //a60 {"die",2188,2194}, {"ding",2201,2209}, {"diu",2210,2210}, {"dong",2211,2220}, {"dou",2221,2228}, {"du",2228,2273}, {"duan",2243,2248}, {"dui",2249,2252}, {"dun",2253,2261}, /********************71*******************/ {"duo",2262,2273}, //a70 {"e",2274,2301}, //e 71 {"en",2287,2287}, {"er",2288,2301}, {"f",2302,2432}, //f 74 {"fa",2302,2337}, {"fan",2310,2337}, {"fang",2327,2337}, {"fei",2338,2349}, {"fen",2350,2379}, /********************81*******************/ {"feng",2365,2379}, //a80 {"fo",2380,2381}, {"fou",2381,2381}, {"fu",2382,2432}, {"g",2433,2593}, //g 84 {"ga",2433,2470}, {"gai",2435,2440}, {"gan",2441,2460}, {"gang",2452,2460}, {"gao",2461,2470}, /********************91*******************/ {"ge",2471,2503}, //a90 {"gei",2488,3488}, {"gen",2489,2503}, {"geng",2491,2503}, {"gong",2504,2518}, {"gou",2519,2527}, {"gu",2528,2593}, {"gua",2546,2568}, {"guai",2552,2554}, {"guan",2555,2568}, /********************101*******************/ {"guang",2566,2568}, //a100 {"gui",2569,2584}, {"gun",2585,2587}, {"guo",2588,2593}, {"h",2594,2786}, //h 104 {"ha",2594,2638}, {"hai",2601,2607}, {"han",2608,2629}, {"hang",2627,2629}, {"hao",2630,2638}, /********************111*******************/ {"he",2639,2667}, //a110 {"hei",2657,2658}, {"hen",2659,2667}, {"heng",2663,2667}, {"hong",2668,2676}, {"hou",2677,2683}, {"hu",2684,2786}, {"hua",2708,2749}, {"huai",2717,2721}, {"huan",2722,2749}, /********************121*******************/ {"huang",2736,2749}, //a120 {"hui",2750,2770}, {"hun",2771,2776}, {"huo",2777,2786}, {"j",2787,3105}, //j 124 {"ji",2787,3046}, {"jia",2846,2949}, {"jian",2863,2921}, {"jiang",2909,2921}, {"jiao",2922,2949}, /********************131*******************/ {"jie",2950,2976}, //a130 {"jin",2977,3027}, {"jing",3003,3027}, {"jiong",3028,3029}, {"jiu",3030,3046}, {"ju",3047,3105}, {"juan",3072,3078}, {"jue",3079,3088}, {"jun",3089,3105}, {"k",3106,3211}, //k 139 /********************141*******************/ {"ka",3106,3131}, //a140 {"kai",3110,3114}, {"kan",3115,3127}, {"kang",3121,3127}, {"kao",3128,3131}, {"ke",3132,3146}, {"ken",3147,3152}, {"keng",3151,3152}, {"kong",3153,3156}, {"kou",3157,3160}, /********************151*******************/ {"l",3212,3471}, //l 150 a150 {"la",3212,3252}, {"lai",3219,3221}, {"lan",3222,3243}, {"lang",3237,3243}, {"lao",3244,3252}, {"le",3253,3268}, {"lei",3255,3265}, {"leng",3266,3268}, {"li",3269,3389}, /********************161*******************/ {"lian",3310,3334}, //a160 {"liang",3324,3334}, {"liao",3335,3347}, {"lie",3348,3352}, {"lin",3353,3378}, {"ling",3365,3378}, {"liu",3379,3389}, {"long",3390,3404}, {"lou",3405,3410}, {"lu",3411,3471}, /********************171*******************/ {"lv",3431,3444}, //a170 {"luan",3445,3450}, {"lve",3451,3452}, {"lun",3453,3459}, {"luo",3460,3471}, {"m",3472,3634}, //m 175 {"ma",3472,3519}, {"mai",3481,3486}, {"man",3487,3507}, {"mang",3502,3507}, /********************181*******************/ {"mao",3508,3519}, //a180 {"me",3520,3547}, {"mei",3521,3536}, {"men",3537,3547}, {"meng",3540,3547}, {"mi",3548,3593}, {"mian",3562,3570}, {"miao",3571,3578}, {"mie",3579,3580}, {"min",3581,3592}, /********************191*******************/ {"ming",3587,3592}, //a190 {"miu",3593,3593}, {"mo",3594,3619}, {"mou",3617,3619}, {"mu",3620,3634}, {"n",3635,3721}, //n 195 {"na",3635,3655}, {"nai",3642,3646}, {"nan",3647,3650}, {"nang",3650,3650}, /********************201*******************/ {"nao",3651,3655}, //a200 {"ne",3656,3660}, {"nei",3657,3658}, {"nen",3659,3660}, {"neng",3660,3660}, {"ni",3661,3706}, {"nian",3672,3680}, {"niag",3679,3680}, {"niao",3681,3682}, {"nie",3683,3689}, /********************211*******************/ {"nin",3690,3702}, //a210 {"ning",3691,3702}, {"niu",3703,3706}, {"nong",3707,3710}, {"nu",3711,3721}, {"nv",3714,3714}, {"nuan",3715,3715}, {"nve",3716,3717}, {"nuo",3718,3721}, {"o",3722,3729}, //o 219 /********************221*******************/ {"ou",3723,3729}, //a220 {"p",3730,3857}, //p 221 {"pa",3730,3761}, {"pai",3736,3741}, {"pan",3742,3754}, {"pang",3750,3754}, {"pao",3755,3761}, {"pei",3762,3770}, {"pen",3771,3786}, {"peng",3773,3786}, /********************231*******************/ {"pi",3787,3833}, //a230 {"pian",3810,3813}, {"piao",3814,3817}, {"pie",3818,3819}, {"pin",3820,3833}, {"ping",3825,3833}, {"po",3834,3842}, {"pou",3842,3842}, {"pu",3843,3857}, {"q",3858,4026}, //q 239 /********************241*******************/ {"qi",3858,3986}, //a240 {"qia",3894,3932}, {"qian",3903,3932}, {"qiang",3925,3932}, {"qiao",3933,3947}, {"qie",3948,3952}, {"qin",3953,3976}, {"qing",3964,3976}, {"qiong",3977,3978}, {"qiu",3979,3986}, /********************251*******************/ {"r",4027,4085}, //r 250 a250 {"ran",4027,4035}, {"rang",4031,4035}, {"rao",4036,4038}, {"re",4039,4040}, {"ren",4041,4052}, {"reng",4051,4052}, {"ri",4053,4053}, {"rong",4054,4063}, {"rou",4064,4066}, /********************261*******************/ {"ru",4067,4085}, //a260 {"ruan",4077,4078}, {"rui",4079,4081}, {"run",4082,4083}, {"ruo",4084,4085}, {"s",4086,4389}, //s 265 {"sa",4086,4109}, {"sai",4089,4092}, {"san",4093,4105}, {"sang",4103,4105}, /********************271*******************/ {"sao",4106,4109}, //a270 {"se",4110,4114}, {"sen",4113,4114}, {"seng",4114,4114}, {"si",4325,4340}, {"song",4341,4348}, {"sou",4349,4352}, {"su",4353,4389}, {"suan",4365,4367}, {"sui",4368,4378}, /********************281*******************/ {"sun",4379,4381}, //a280 {"suo",4382,4389}, {"sh",4115,4324}, {"sha",4115,4160}, {"shai",4124,4125}, {"shan",4126,4149}, {"shang",4142,4149}, {"shao",4150,4160}, {"she",4161,4205}, {"shen",4173,4205}, /********************291*******************/ {"sheng",4189,4205}, //a290 {"shi",4206,4252}, {"shou",4253,4262}, {"shu",4263,4324}, {"shua",4302,4312}, {"shuai",4304,4307}, {"shuan",4308,4312}, {"shuang",4310,4312}, {"shui",4313,4316}, {"shun",4317,4320}, /********************301*******************/ {"shuo",4321,4324}, //a300 {"t",4390,4557}, //t 301 {"ta",4390,4455}, {"tai",4405,4413}, {"tan",4414,4444}, {"tang",4432,4444}, {"tao",4445,4455}, {"te",4456,4460}, {"teng",4457,4460}, {"ti",4461,4507}, /********************311*******************/ {"tian",4476,4483}, //a310 {"tiao",4484,4488}, {"tie",4489,4491}, {"ting",4492,4507}, {"tong",4508,4520}, {"tou",4521,4524}, {"tu",4525,4557}, {"tuan",4536,4537}, {"tui",4538,4543}, {"tun",4544,4546}, /********************321*******************/ {"tuo",4547,4557}, //a320 {"w",4558,4683}, //w 321 {"wa",4558,4593}, {"wai",4565,4566}, {"wan",4567,4593}, {"wang",4584,4593}, {"wei",4594,4632}, {"wen",4633,4645}, {"weng",4643,4645}, {"wo",4646,4654}, /********************331*******************/ {"wu",4655,4683}, //a330 {"x",4684,4924}, //x 331 {"xi",4684,4869}, {"xia",4725,4783}, {"xian",4738,4783}, {"xiang",4764,4783}, {"xiao",4784,4807}, {"xie",4808,4828}, {"xin",4829,4853}, {"xing",4839,4853}, /********************341*******************/ {"xiong",4854,4860}, //a340 {"xiu",4861,4869}, {"xu",4870,4924}, {"xuan",4889,4904}, {"xue",4905,4910}, {"xun",4911,4924}, {"y",4925,5248}, //y 346 {"ya",4925,5011}, {"yan",4941,4990}, {"yang",4974,4990}, /********************351*******************/ {"yao",4991,5011}, //a350 {"ye",5012,5026}, {"yi",5027,5119}, {"yin",5080,5119}, {"ying",5102,5119}, {"yo",5120,5155}, {"yong",5121,5135}, {"you",5136,5155}, {"yu",5156,5248}, {"yuan",5207,5226}, /********************361*******************/ {"yue",5227,5236}, //a360 {"yun",5237,5248}, {"z",5249,5589}, //z 362 {"za",5249,5279}, {"zai",5252,5258}, {"zan",5259,5262}, {"zang",5263,5265}, {"zao",5266,5279}, {"ze",5280,5289}, {"zei",5284,5284}, /********************371*******************/ {"zen",5285,5285}, //a370 {"zeng",5286,5289}, {"zi",5540,5554}, {"zong",5555,5561}, {"zou",5562,5565}, {"zu",5566,5589}, {"zuan",5574,5575}, {"zui",5576,5579}, {"zun",5580,5581}, {"zuo",5582,5589}, /********************381*******************/ {"zh",5290,5539}, //a380 {"zha",5290,5357}, {"zhai",5310,5315}, {"zhan",5316,5347}, {"zhang",5333,5347}, {"zhao",5348,5357}, {"zhe",5358,5404}, {"zhen",5368,5404}, {"zheng",5384,5404}, {"zhi",5405,5447}, /********************391*******************/ {"zhong",5448,5458}, //a390 {"zhou",5459,5472}, {"zhu",5473,5539}, {"zhua",5505,5506}, {"zhuai",5507,5507}, {"zhuan",5508,5520}, {"zhuang",5514,5520}, {"zhui",5521,5526}, {"zhun",5527,5528}, {"zhuo",5529,5539} /********************共400*******************/ }; unsigned char code number_tab[10*12]= { /*0*/ 0x00,0xE0,0x10,0x10,0x10,0xE0,0x00,0x7F,0x80,0x80,0x80,0x7F, /*1*/ 0x00,0x00,0x20,0xF0,0x00,0x00,0x00,0x00,0x80,0xFF,0x80,0x00, /*2*/ 0x20,0x10,0x10,0x10,0x10,0xE0,0xFC,0x84,0x84,0x84,0x84,0x83, /*3*/ 0x20,0x10,0x10,0x10,0x10,0xE0,0x40,0x80,0x82,0x82,0x82,0x7D, /*4*/ 0xF0,0x00,0x00,0xF0,0x00,0x00,0x07,0x04,0x84,0xFF,0x84,0x04, /*5*/ 0xF0,0x10,0x10,0x10,0x10,0x10,0x43,0x82,0x82,0x82,0x82,0x7C, /*6*/ 0xE0,0x10,0x10,0x10,0x10,0x20,0x7F,0x82,0x82,0x82,0x82,0x7C, /*7*/ 0x10,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0xFC,0x03, /*8*/ 0xE0,0x10,0x10,0x10,0x10,0xE0,0x7F,0x82,0x82,0x82,0x82,0x7F, /*9*/ 0xE0,0x10,0x10,0x10,0x10,0xE0,0x43,0x84,0x84,0x84,0x84,0x7F }; unsigned char code dot[12]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00, }; 涉及的文件就有上面3个 提示的错误代码如下: 只有本站会员才能查看附件,请 登录 只有本站会员才能查看附件,请 登录 |