欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3848|回復: 6
打印 上一主題 下一主題
收起左側

幫我看看我的程序那里錯了

[復制鏈接]
跳轉到指定樓層
樓主
ID:45218 發表于 2012-10-4 10:23 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
#define uint unsigned int #define uchar unsigned char uchar temp; void delay(); void main() { while(1) temp=0xfe; P1=temp; { temp= _crol_ (temp,1); delay(); P1=temp; } } void delay() { uint x,y; for(x=100;x>0;x--) for(y=100;y>0;y--); }
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:45218 發表于 2012-10-4 10:23 | 只看該作者
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay();
void main()
{
 while(1)
  temp=0xfe;
  P1=temp;
  {
   temp= _crol_ (temp,1);
   delay();
   P1=temp; 
  }
}
void delay()
{
 uint x,y;
 for(x=100;x>0;x--)
  for(y=100;y>0;y--);
}
回復

使用道具 舉報

板凳
ID:45218 發表于 2012-10-4 14:38 | 只看該作者

我就不知道自己錯在哪里這么回事呀!!!

希望大師傅們教我!!!

#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay();
void main()
{
 while(1)
  temp=0xfe;
  P1=temp;
  {
   temp= _crol_ (temp,1);
   delay();
   P1=temp; 
  }
}
void delay()
{
 uint x,y;
 for(x=100;x>0;x--)
  for(y=100;y>0;y--);
}

回復

使用道具 舉報

地板
ID:45200 發表于 2012-10-4 15:21 | 只看該作者

你是要做跑馬燈吧

我在你的程序上修改了下:

#include<intrins.h>

#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay();
void main()
{
 
  temp=0xfe;
  P1=temp;
  while(1)
  {
   temp= _crol_ (temp,1);
   delay();
   P1=temp;
  }
}
void delay()
{
 uint x,y;
 for(x=100;x>0;x--)
  for(y=100;y>0;y--);
}
運行過的,可以用的。

回復

使用道具 舉報

5#
ID:45200 發表于 2012-10-4 15:23 | 只看該作者

#include<reg51.h>

少了上面這個頭文件!

回復

使用道具 舉報

6#
ID:45218 發表于 2012-10-5 09:01 | 只看該作者

非常感謝,我是初學單片機很多地方都不是很明白。希望能和各位師傅們常交流!!!

回復

使用道具 舉報

7#
ID:37087 發表于 2012-10-13 10:48 | 只看該作者
while錯了,你這樣寫是個死循環。
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表