亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

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

哪位大神看下 為什么狀態不能循環

[復制鏈接]
跳轉到指定樓層
樓主
ID:117161 發表于 2017-6-14 20:42 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
#include<reg51.h>
#include<intrins.h>
sbit P3_0=P3^0;
// unsigned char led[]={0x90,0x82,0xc0,0x90,0xa4,0xc0};
// unsigned char led1[]={0x90,0xc0,0xf9,0xa4,0xa4,0x92};
// unsigned char led2[]={0xff,0xff,0xff,0xff,0xff,
//       0x89,0x86,0xc7,0xc7,0xc0,0xff};
// unsigned char com[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,};
// unsigned char j,n,x;
void delay(unsigned int i)
{
unsigned int k;
for(k=0;k<i;k++);
}
void disp1()
{
unsigned char led[]={0x90,0x82,0xc0,0x90,0xa4,0xc0};
unsigned char x,w;  
   w=0xfe;
  for(x=0;x<6;x++)
      {
       P1=0xff;
    P2=w;
    w=_crol_(w,1);
    P1=led[x];
    delay(100);
       }
   }
  void disp2()
{
unsigned char led1[]={0x90,0xc0,0xf9,0xa4,0xa4,0x92};
unsigned char y,d;
   d=0xfe;
  for(y=0;y<6;y++)
      {
       P1=0xff;
    P2=d;
    d=_crol_(d,1);
    P1=led1[y];
    delay(100);
         
       }
   }
  void disp3()   
  {
    unsigned char led2[]={0xff,0xff,0xff,0xff,0xff,
       0x89,0x86,0xc7,0xc7,0xc0,0xff};
    unsigned char com[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,};
    unsigned char i,j,n;
   {for(n=0;n<6;n++) //HELLO
     for(j=0;j<100;j++)
      for(i=0;i<6;i++)
     {
       P1=0xff;
    P2=com[i];
    P1=led2[n+i];
    delay(100);
      }   
       }
   }   
  void main()
{
  unsigned char num;
  P1=0xff;
   while(1)
   {   
      if(P3_0==0)
   {
    delay(10);
  if(P3_0==0)
   {
     num++;
    if(num==3)
  {
  num=0;
  }
while(P3_0==0);
   }
   }
  
   switch(num)
      {
   case 0:disp1();break;
   case 1:disp2();break;
   case 2:disp3();break;
   }
    }
  }

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:89515 發表于 2017-6-15 01:19 | 只看該作者
延時時間太短
回復

使用道具 舉報

板凳
ID:211416 發表于 2017-6-15 09:39 | 只看該作者
延時時間可能短了
回復

使用道具 舉報

無效樓層,該帖已經被刪除
5#
ID:211740 發表于 2017-6-16 00:14 | 只看該作者
此程序是不是完成按key1,key2,key3時執行對應的顯示dis1,dis2,dis3
可能是在顯示函數中沒有出來,在switch處設置斷點調試就能看出來。
回復

使用道具 舉報

6#
ID:211740 發表于 2017-6-16 00:18 | 只看該作者
在switch處設置斷點看看,可能是沒有從顯示函數返回。
回復

使用道具 舉報

7#
ID:211773 發表于 2017-6-16 09:37 | 只看該作者
switch(num)       {    case 0:disp1();break;    case 1:disp2();break;    case 2:disp3();break;    }     }   } 沒有結束語句
回復

使用道具 舉報

8#
ID:211778 發表于 2017-6-16 09:46 | 只看該作者
if(num>=3)
回復

使用道具 舉報

9#
ID:211792 發表于 2017-6-16 10:22 | 只看該作者
時間短什么的不是問題,關鍵是關聯有問題
回復

使用道具 舉報

10#
ID:117161 發表于 2017-6-26 10:46 | 只看該作者
是dis3  沒掃完
回復

使用道具 舉報

11#
無效樓層,該帖已經被刪除
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

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

Powered by 單片機教程網

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