以下是我編的程序:
#include<reg52.h>
#include<intrins.h>//循環左移頭文件
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay(uint);
void main()
{
temp=0xfe;
P1=temp;
while(1)
{
temp=_crol_(temp,1);
delay(500);
P1=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=100;x>0;x--)
for(y=z;y>0;y--);
}
這個程序build target沒有錯誤,但燒錄程序后LED不亮,電源指示燈亮(開發板是沒有問題)
我是一個新手,剛開始學,請各位高手指導。
謝謝!
你要先把p1.4拉低,然后修改上面的程序,把p0改為p1就可以了,我在這里測試你的程序除了這個外 沒有其他的錯誤.
如果有不懂 請看http://www.raoushi.com/bbs/dpj-4882-1.html
| 歡迎光臨 (http://www.raoushi.com/bbs/) | Powered by Discuz! X3.1 |