![]() |
發(fā)布時間: 2019-3-21 22:29
正文摘要:#include<reg52.h> #define uint unsigned int #define uchar unsigned char #define temp P3; sfr P4=0xc0; sbit p42=P4^2; sbit p44=P4^4; uchar code duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf ... |
可以應(yīng)用調(diào)試 |
用什么單片機,就要用對應(yīng)的頭文件。 錯誤在:#define temp P3; 這個定義語句后面不能加“;” |
ahshmj 發(fā)表于 2019-3-22 06:31 這是IAP15F2K61S2芯片,加轉(zhuǎn)接板的 P3^6,P3^7被P4^2,P4^4代替了 |
zhb2004xp 發(fā)表于 2019-3-22 01:28 唉,破腦殼。多謝指點 |
ping264888 發(fā)表于 2019-3-22 08:08 多謝多謝,剛出道,多多指教 |
新人常犯錯誤, #define后面加分號. 標記一下. 警示一下自己. |
你用的頭文件不對,reg52.h是對基本型89*52的,沒有“P4”端口的。 你用什么單片機,就要用對應(yīng)的頭文件。 |
錯誤在第三行:#define temp P3; 這個定義語句后面不能加“;”,去掉就好了~ |
Powered by 單片機教程網(wǎng)