![]() |
發布時間: 2021-6-4 15:56
正文摘要:在其他地方查的結果是有定義的程序段沒有用上,但是我仔細檢查了,確實都用上了的。因為這個原因也沒辦法編譯出來,所以就很難受,想知道是因為啥? ERROR L104: MULTIPLE PUBLIC DEFINITIONS |
STOP、DELAY這些提示錯誤的符號都在哪里定義的??? |
沒提示錯誤的函數你貼上來了,提示錯誤的函數看不到。 |
用到的函數都沒有聲明 |
#include <STC15.H> #include "PCF8574.h" /************IO口工作模式初始化函數***********/ void IO_Init(void) { P0M0=0x00; P0M1=0x00; P1M0=0x00; P1M1=0x00; P2M0=0x00; P2M1=0x00; P3M0=0x00; P3M1=0x00; P4M0=0x00; P4M1=0x00; P5M0=0x00; P5M1=0x00; } /**************延時函數ms**************/ void delayms(unsigned int t) //@12.000MHz { unsigned int i; unsigned char j,k; for(i=0;i<t;i++) for(j=0;j<35;j++) for(k=0;k<80;k++); } void delay1(uchar x) { uchar a,b; for(a=x;a>0;a--) for(b=200;b>0;b--); } void write_com(uchar com) //寫命令函數 { uchar com1,com2; com1=com|0x0f; write_add(com1&0xfc); delay1(2); write_add(com1&0xf8); com2=com<<4; com2=com2|0x0f; write_add(com2&0xfc); delay1(2); write_add(com2&0xf8); } void write_date(uchar date) //寫數據函數 { uchar date1,date2; date1=date|0x0f; write_add(date1&0xfd); delay1(2); write_add(date1&0xf9); date2=date<<4; date2=date2|0x0f; write_add(date2&0xfd); delay1(2); write_add(date2&0xf9); } void init_lcd(void) //初始化函數 { write_com(0x33); //顯示模式設置 delayms(6); write_com(0x32); //顯示模式設置 delayms(6); write_com(0x28); //4位總線,雙行顯示,顯示5×7的點陣字符 delayms(6); write_com(0x01); //清屏 delayms(6); write_com(0x06); //字符進入模式:屏幕不動,字符后移 delayms(6); write_com(0x0c); //顯示開,關光標 //write_LCD_Command(0x0f); //顯示開,開光標,光標閃爍 delayms(6); } //顯示字符串:第x行第y列顯示什么內容 void ShowStr(unsigned char x,unsigned char y,unsigned char *str) { if(x == 1) { write_com(0x80 | y-1); } if(x == 2) { write_com(0xc0 | y-1); } //輸出字符串 while(*str!='\0') { write_date(*str); str++; } } 附上程序 |