久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3255|回復(fù): 18
打印 上一主題 下一主題
收起左側(cè)

單片機(jī)3P口24LED跑馬燈程序求助

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:471297 發(fā)表于 2021-12-21 13:10 | 只看該作者 |只看大圖 回帖獎勵(lì) |倒序?yàn)g覽 |閱讀模式
50黑幣
3P口24LED跑馬燈程序求助。目前P0和P1口正常,請教增加P2口程序怎么修改呢?還有通電時(shí)不要讓LED全部亮要怎么修改呢?
效果:


單片機(jī)程序:
  1. #include <REG52.H>

  2. unsigned char RunMode;
  3. //**********************************System Fuction*************************************************
  4. void Delay1ms(unsigned int count)
  5. {
  6.         unsigned int i,j;
  7.         for(i=0;i<count;i++)
  8.         for(j=0;j<120;j++);
  9. }


  10. unsigned char GetKey(void)
  11. {
  12.         unsigned char KeyTemp,CheckValue,Key = 0x00;
  13.         CheckValue = P3&0x32;
  14.         if(CheckValue==0x32)
  15.                 return 0x00;
  16.         
  17.         Delay1ms(10);  //延遲1ms(10)
  18.         KeyTemp = P3&0x32;
  19.         if(KeyTemp==CheckValue)
  20.                 return 0x00;

  21.         if(!(CheckValue&0x02))
  22.                 Key|=0x01;
  23.         if(!(CheckValue&0x10))
  24.                 Key|=0x02;
  25.         if(!(CheckValue&0x20))
  26.                 Key|=0x04;
  27.         return Key;
  28. }

  29. unsigned int TimerCount,SystemSpeed,SystemSpeedIndex;
  30. void InitialTimer2(void)
  31. {
  32.         T2CON  = 0x00;                        //16 Bit Auto-Reload Mode
  33.          TH2 = RCAP2H = 0xFC;          //重裝值,初始值        TL2 = RCAP2L = 0x18;
  34.         ET2=1;                                        //定時(shí)器 2 中斷允許
  35.         TR2 = 1;                                //定時(shí)器 2 啟動
  36.         EA=1;
  37. }

  38. unsigned int code SpeedCode[]={   1,   2,   3,   5,   8,  10,  14,  17,  20,  30,
  39.                                                              40,  50,  60,  70,  80,  90, 100, 120, 140, 160,
  40.                                                                 180, 200, 300, 400, 500, 600, 700, 800, 900,1000};//30
  41. void SetSpeed(unsigned char Speed)
  42. {
  43.         SystemSpeed =SpeedCode[Speed];
  44. }

  45. void LEDShow(unsigned int LEDStatus)
  46. {
  47.         P0 = ~(LEDStatus&0x00FF);
  48.         P1 = ~((LEDStatus>>8)&0x00FF);
  49.   
  50. }

  51. void InitialCPU(void)
  52. {
  53.         RunMode = 0x00;
  54.         TimerCount = 0;
  55.         SystemSpeedIndex = 10;

  56.         P1 = 0x00;
  57.         P0 = 0x00;
  58.         P2 = 0x00;
  59.         P3 = 0xFF;
  60.         Delay1ms(500);
  61.         P1 = 0xFF;
  62.         P0 = 0xFF;
  63.         P2 = 0xFF;
  64.         P3 = 0xFF;
  65.         SetSpeed(SystemSpeedIndex);
  66.         
  67. }

  68. //Mode 0
  69. unsigned int LEDIndex = 0;
  70. bit LEDDirection = 1,LEDFlag = 1;

  71. void Mode_0(void)
  72. {
  73.         if(LEDDirection)
  74.                 LEDShow(0x0001<<LEDIndex);
  75.         else
  76.                 LEDShow(0x8000>>LEDIndex);
  77.         if(LEDIndex==15)
  78.                 LEDDirection = !LEDDirection;
  79.    LEDIndex = (LEDIndex+1)%16;
  80. }

  81. void TimerEventRun(void)
  82. {
  83.         
  84.         if(RunMode ==0x00)
  85.         {
  86.                 Mode_0();
  87.         }

  88. }

  89. void Timer2(void) interrupt 5 using 3
  90. {
  91.         TF2 = 0;         //中斷標(biāo)志清除( Timer2 必須軟件清標(biāo)志!)
  92.         if(++TimerCount>=SystemSpeed)
  93.         {
  94.                 TimerCount = 0;
  95.                 TimerEventRun();
  96.            }
  97. }
  98. unsigned char MusicIndex = 0;
  99. void KeyDispose(unsigned char Key)
  100. {
  101.         
  102.         if(Key&0x02)
  103.         {
  104.                 if(SystemSpeedIndex>0)
  105.                 {
  106.                         --SystemSpeedIndex;
  107.                         SetSpeed(SystemSpeedIndex);
  108.                 }
  109.                 else
  110.                 {
  111.                         
  112.                 }
  113.         }
  114.         if(Key&0x04)
  115.         {
  116.                 if(SystemSpeedIndex<28)
  117.                 {
  118.                         ++SystemSpeedIndex;
  119.                         SetSpeed(SystemSpeedIndex);
  120.                 }
  121.                 else
  122.                 {
  123.                         
  124.                 }
  125.         }        
  126. }

  127. //***********************************************************************************
  128. main()
  129. {
  130.         unsigned char Key;
  131.         InitialCPU();
  132.         InitialTimer2();

  133.         while(1)
  134.         {
  135.                 Key = GetKey();
  136.                 if(Key!=0x00)
  137.                 {
  138.                         KeyDispose(Key);
  139.                 }
  140.         }
  141. }
復(fù)制代碼



24LED流水燈仿真.rar

122.22 KB, 下載次數(shù): 12

最佳答案

查看完整內(nèi)容

如果,上面一個(gè)有問題的話,用這個(gè): void Mode_0(void) { unsigned char temp; if(LEDDirection) { temp = (0x01 >3) == 0) P0 = ~temp; else P0 = 0xff; if((LEDIndex>>3) == 1) P1 = ~temp; else P1 = 0xff; if((LEDIndex>>3) == 2) P2 = ~temp; else P2 = 0xff; } else { temp = (0x80 >> (LEDIndex & 0x07)); if((LEDIndex>>3) == 2) P0 = ~temp; else P0 = 0xff ...
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:624769 發(fā)表于 2021-12-21 13:10 | 只看該作者
網(wǎng)絡(luò)不安全 發(fā)表于 2021-12-21 20:24
求大神幫助,不要石沉大海啦

如果,上面一個(gè)有問題的話,用這個(gè):

void Mode_0(void)
{
        unsigned char        temp;
        if(LEDDirection)
        {
                temp = (0x01 << (LEDIndex & 0x07));
                if((LEDIndex>>3) == 0)        P0 = ~temp;
                else        P0 = 0xff;
                if((LEDIndex>>3) == 1)        P1 = ~temp;
                else        P1 = 0xff;
                if((LEDIndex>>3) == 2)        P2 = ~temp;
                else        P2 = 0xff;
        }
        else
        {
                temp = (0x80 >> (LEDIndex & 0x07));
                if((LEDIndex>>3) == 2)        P0 = ~temp;
                else        P0 = 0xff;
                if((LEDIndex>>3) == 1)        P1 = ~temp;
                else        P1 = 0xff;
                if((LEDIndex>>3) == 0)        P2 = ~temp;
                else        P2 = 0xff;       
        }
           if(++LEDIndex == 24)
        {
                LEDIndex = 0;
                LEDDirection = !LEDDirection;
        }
}
回復(fù)

使用道具 舉報(bào)

板凳
ID:471297 發(fā)表于 2021-12-21 15:22 | 只看該作者
通電不讓LED全亮已解決
回復(fù)

使用道具 舉報(bào)

地板
ID:161164 發(fā)表于 2021-12-21 15:39 | 只看該作者
試試這樣改
  1. void LEDShow(unsigned long LEDStatus)
  2. {
  3.         P0 = ~(LEDStatus&0x00FF);
  4.         P1 = ~((LEDStatus>>8)&0x00FF);
  5.         P2 = ~((LEDStatus>>16)&0x00FF);  /<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  6. }
  7. void Mode_0(void)
  8. {
  9.         if(LEDDirection)
  10.                 LEDShow(0x000001<<LEDIndex);  /<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  11.         else
  12.                 LEDShow(0x800000>>LEDIndex);  /<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  13.         if(LEDIndex==23)  /<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  14.                 LEDDirection = !LEDDirection;
  15.    LEDIndex = (LEDIndex+1)%24;  /<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  16. }
復(fù)制代碼



回復(fù)

使用道具 舉報(bào)

5#
ID:471297 發(fā)表于 2021-12-21 16:27 | 只看該作者

您好,我按您的方法修改了,P2口LED全亮閃一下,不能往返,是不是還有地方需要修改呢?
  1. #include <REG52.H>

  2. unsigned char RunMode;
  3. //**********************************System Fuction*************************************************
  4. void Delay1ms(unsigned int count)
  5. {
  6.         unsigned int i,j;
  7.         for(i=0;i<count;i++)
  8.         for(j=0;j<120;j++);
  9. }


  10. unsigned char GetKey(void)
  11. {
  12.         unsigned char KeyTemp,CheckValue,Key = 0x00;
  13.         CheckValue = P3&0x32;
  14.         if(CheckValue==0x32)
  15.                 return 0x00;
  16.         
  17.         Delay1ms(10);  //延遲1ms(10)
  18.         KeyTemp = P3&0x32;
  19.         if(KeyTemp==CheckValue)
  20.                 return 0x00;

  21.         if(!(CheckValue&0x02))
  22.                 Key|=0x01;
  23.         if(!(CheckValue&0x10))
  24.                 Key|=0x02;
  25.         if(!(CheckValue&0x20))
  26.                 Key|=0x04;
  27.         return Key;
  28. }

  29. unsigned int TimerCount,SystemSpeed,SystemSpeedIndex;
  30. void InitialTimer2(void)
  31. {
  32.         T2CON  = 0x00;                        //16 Bit Auto-Reload Mode
  33.         TH2 = RCAP2H = 0xFC;          //重裝值,初始值        TL2 = RCAP2L = 0x18;
  34.         ET2=1;                                        //定時(shí)器 2 中斷允許
  35.         TR2 = 1;                                //定時(shí)器 2 啟動
  36.         EA=1;
  37. }

  38. unsigned int code SpeedCode[]={   1,   2,   3,   5,   8,  10,  14,  17,  20,  30,
  39.                                                              40,  50,  60,  70,  80,  90, 100, 120, 140, 160,
  40.                                                                 180, 200, 300, 400, 500, 600, 700, 800, 900,1000};//30
  41. void SetSpeed(unsigned char Speed)
  42. {
  43.         SystemSpeed =SpeedCode[Speed];
  44. }

  45. void LEDShow(unsigned long LEDStatus)    //修改處
  46. {
  47.         P0 = ~(LEDStatus&0x00FF);
  48.         P1 = ~((LEDStatus>>8)&0x00FF);
  49.         P2 = ~((LEDStatus>>16)&0x00FF);  //修改處
  50. }

  51. void InitialCPU(void)
  52. {
  53.         RunMode = 0x00;
  54.         TimerCount = 0;
  55.         SystemSpeedIndex = 10;

  56.         P0 = 0xFF;
  57.         P1 = 0xFF;
  58.         P2 = 0xFF;
  59.         P3 = 0xFF;
  60.         Delay1ms(500);
  61.         P0 = 0xFF;
  62.         P1 = 0xFF;
  63.         P2 = 0xFF;
  64.         P3 = 0xFF;
  65.         SetSpeed(SystemSpeedIndex);
  66.         
  67. }

  68. //Mode 0
  69. unsigned int LEDIndex = 0;
  70. bit LEDDirection = 1,LEDFlag = 1;

  71. void Mode_0(void)
  72. {
  73.         if(LEDDirection)
  74.                 LEDShow(0x000001<<LEDIndex);   //修改處
  75.         else
  76.                 LEDShow(0x800000>>LEDIndex);   //修改處
  77.         if(LEDIndex==23)                       //修改處
  78.                 LEDDirection = !LEDDirection;
  79.    LEDIndex = (LEDIndex+1)%24;                 //修改處
  80. }

  81. void TimerEventRun(void)
  82. {
  83.         
  84.         if(RunMode ==0x00)
  85.         {
  86.                 Mode_0();
  87.         }

  88. }

  89. void Timer2(void) interrupt 5 using 3
  90. {
  91.         TF2 = 0;         //中斷標(biāo)志清除( Timer2 必須軟件清標(biāo)志!)
  92.         if(++TimerCount>=SystemSpeed)
  93.         {
  94.                 TimerCount = 0;
  95.                 TimerEventRun();
  96.            }
  97. }
  98. unsigned char MusicIndex = 0;
  99. void KeyDispose(unsigned char Key)
  100. {
  101.         
  102.         if(Key&0x02)
  103.         {
  104.                 if(SystemSpeedIndex>0)
  105.                 {
  106.                         --SystemSpeedIndex;
  107.                         SetSpeed(SystemSpeedIndex);
  108.                 }
  109.                 else
  110.                 {
  111.                         
  112.                 }
  113.         }
  114.         if(Key&0x04)
  115.         {
  116.                 if(SystemSpeedIndex<28)
  117.                 {
  118.                         ++SystemSpeedIndex;
  119.                         SetSpeed(SystemSpeedIndex);
  120.                 }
  121.                 else
  122.                 {
  123.                         
  124.                 }
  125.         }        
  126. }

  127. //***********************************************************************************
  128. main()
  129. {
  130.         unsigned char Key;
  131.         InitialCPU();
  132.         InitialTimer2();

  133.         while(1)
  134.         {
  135.                 Key = GetKey();
  136.                 if(Key!=0x00)
  137.                 {
  138.                         KeyDispose(Key);
  139.                 }
  140.         }
  141. }
復(fù)制代碼


回復(fù)

使用道具 舉報(bào)

6#
ID:471297 發(fā)表于 2021-12-21 20:24 | 只看該作者
求大神幫助,不要石沉大海啦
回復(fù)

使用道具 舉報(bào)

7#
ID:624769 發(fā)表于 2021-12-22 00:31 | 只看該作者
網(wǎng)絡(luò)不安全 發(fā)表于 2021-12-21 20:24
求大神幫助,不要石沉大海啦

void LEDShow(unsigned long LEDStatus)
{
        unsigned char temp;
        temp        = LEDStatus;
        P0        = ~temp;
        temp        = LEDStatus >> 8;
        P1        = ~temp;
        temp        = LEDStatus >> 16;
        P2        = ~temp;
}

void Mode_0(void)
{
        if(LEDDirection)
                LEDShow(0x00000001<<LEDIndex);
        else
                LEDShow(0x00800000>>LEDIndex);
           if(++LEDIndex == 24)
        {
                LEDIndex = 0;
                LEDDirection = !LEDDirection;
        }
}
回復(fù)

使用道具 舉報(bào)

8#
ID:471297 發(fā)表于 2021-12-22 01:00 | 只看該作者
188610329 發(fā)表于 2021-12-22 00:31
void LEDShow(unsigned long LEDStatus)
{
        unsigned char temp;

您好,我按您的方法修改后,仿真效果和第一次修改的一樣,燈跑到P2口就8只一起亮,然后返回不亮,可能其他地方也有錯(cuò)吧。附件里有仿真+程序,您方便幫我試試嗎?
回復(fù)

使用道具 舉報(bào)

9#
ID:844772 發(fā)表于 2021-12-22 09:06 | 只看該作者
1.我這臺電腦只能上網(wǎng),不能測試了。
2.應(yīng)該是這句問題 LEDShow(0x00000001<<LEDIndex); 它實(shí)際只傳遞了24位,你要是改,大致是改函數(shù)void Mode_0(void),
3.在C51你即使用強(qiáng)制類轉(zhuǎn)換也傳不過去(不知新版的是不是可以了。)   
4.建議觀察void LEDShow(unsigned long LEDStatus)中temp值是否正確,最好加上&0xFF.
void Mode_0(void)
{     unsigned long LEDStatus;
        if(LEDDirection)
            {   LEDStatus=0x00000001;
                LEDStatus<<=LEDIndex;
                LEDShow(LEDStatus);
            }
        else
           {   LEDStatus=0x00800000;
               LEDStatus <<=LEDIndex;
                LEDShow(LEDStatus);
            }
           if(++LEDIndex == 24)
        {
                LEDIndex = 0;
                LEDDirection = !LEDDirection;
        }
}
回復(fù)

使用道具 舉報(bào)

10#
ID:161164 發(fā)表于 2021-12-22 12:00 | 只看該作者
網(wǎng)絡(luò)不安全 發(fā)表于 2021-12-21 16:27
您好,我按您的方法修改了,P2口LED全亮閃一下,不能往返,是不是還有地方需要修改呢?

我用我的代碼加上強(qiáng)制轉(zhuǎn)換數(shù)據(jù)類型就可以了不知道為什么你的代碼不行





  1. #include <STC89C5xRC.H>
  2. #define u16 unsigned int
  3. #define u8 unsigned char
  4. #define TMR_Max 1

  5. typedef struct {
  6.     u16 ACC;
  7.     u16 PRE;
  8.     u8 DN:1;
  9. } TIMER;
  10. TIMER TMR[TMR_Max];
  11. #define TMR_XX TMR[0]
  12. void Timer0Init()                //1ms@12.000MHz 12T
  13. {
  14.     TMOD &= 0xF0;                //設(shè)置定時(shí)器模式
  15.     TMOD |= 0x01;                //設(shè)置定時(shí)器模式
  16.     TL0 = 0x18;                //設(shè)置定時(shí)初始值
  17.     TH0 = 0xFC;                //設(shè)置定時(shí)初始值
  18.     TF0 = 0;                //清除TF0標(biāo)志
  19.     TR0 = 1;                //定時(shí)器0開始計(jì)時(shí)
  20. }
  21. void timer0_int () interrupt 1
  22. {u8 i;
  23.     TL0 = 0x18;                //設(shè)置定時(shí)初始值
  24.     TH0 = 0xFC;                //設(shè)置定時(shí)初始值
  25.                 for(i = 0;i < TMR_Max;i++)
  26.                 {
  27.                         if(!TMR[i].DN)
  28.                         {
  29.                                 if(++TMR[i].ACC >= TMR[i].PRE)
  30.                                 {
  31.                                         TMR[i].DN = 1;
  32.                                         TMR[i].ACC= 0;
  33.                                 }
  34.                         }
  35.                 }
  36. }

  37. void LEDShow(unsigned long LEDStatus)
  38. {
  39.     P0 = ~(LEDStatus & 0x00FF);
  40.     P1 = ~((LEDStatus >> 8) & 0x00FF);
  41.     P2 = ~((LEDStatus >> 16) & 0x00FF);
  42. }
  43. //Mode 0
  44. unsigned int LEDIndex = 0;
  45. bit LEDDirection = 1, LEDFlag = 1;
  46. void Mode_0(void)
  47. {
  48.     if(LEDDirection)
  49.         LEDShow((unsigned long)0x000001 << LEDIndex); //修改處
  50.     else
  51.         LEDShow((unsigned long)0x800000 >> LEDIndex); //修改處
  52.     if(LEDIndex == 23)
  53.         LEDDirection = !LEDDirection;
  54.     LEDIndex = (LEDIndex + 1) % 24;
  55. }
  56. void main()
  57. {
  58.         Timer0Init();
  59.     ET0 = 1;                        //Timer0 interrupt Enable
  60.     EA = 1;                                //All interrupt Enable
  61.         TMR_XX.PRE = 50;
  62.        
  63.         while(1)
  64.         {
  65.                 if(TMR_XX.DN)
  66.                 {TMR_XX.DN = 0;
  67.                         Mode_0();
  68.                 }
  69.         }
  70. }
復(fù)制代碼



回復(fù)

使用道具 舉報(bào)

11#
ID:332444 發(fā)表于 2021-12-22 15:34 | 只看該作者
既然已經(jīng)解決,何必重提?

1.gif (132.92 KB, 下載次數(shù): 40)

1.gif
回復(fù)

使用道具 舉報(bào)

12#
ID:471297 發(fā)表于 2021-12-23 12:20 | 只看該作者
lkc8210 發(fā)表于 2021-12-22 12:00
我用我的代碼加上強(qiáng)制轉(zhuǎn)換數(shù)據(jù)類型就可以了不知道為什么你的代碼不行

我這個(gè)代碼應(yīng)該有問題吧
回復(fù)

使用道具 舉報(bào)

13#
ID:94031 發(fā)表于 2021-12-23 13:42 | 只看該作者
網(wǎng)絡(luò)不安全 發(fā)表于 2021-12-23 12:20
我這個(gè)代碼應(yīng)該有問題吧

10樓chengxujiegoujiugengnibuyiyang
回復(fù)

使用道具 舉報(bào)

14#
ID:94031 發(fā)表于 2021-12-23 13:47 | 只看該作者
xuyaqi 發(fā)表于 2021-12-23 13:42
10樓chengxujiegoujiugengnibuyiyang

10樓程序結(jié)構(gòu)就跟你不一樣,先看懂別人程序。
回復(fù)

使用道具 舉報(bào)

15#
ID:624769 發(fā)表于 2021-12-23 15:15 | 只看該作者
網(wǎng)絡(luò)不安全 發(fā)表于 2021-12-23 12:20
我這個(gè)代碼應(yīng)該有問題吧

應(yīng)該是你仿真有問題,不支持16位以上,所以,我一共給你寫了兩個(gè)版本,8位和32位,但是,最后是32位的不行,8位的版本就OK了。所以,問題應(yīng)該在你的仿真上,如果直接下載到單片機(jī),應(yīng)該兩個(gè)都能用。
回復(fù)

使用道具 舉報(bào)

16#
ID:332444 發(fā)表于 2021-12-23 19:03 | 只看該作者
簡單的計(jì)數(shù)判斷輕松實(shí)現(xiàn)用不了寫那么多代碼,都是掩人耳目的伎倆。
回復(fù)

使用道具 舉報(bào)

17#
ID:471297 發(fā)表于 2021-12-24 10:11 | 只看該作者
請教CheckValue = P3&0x32;//按鍵接在p3.1 p3.4 p3.5這個(gè)是怎么計(jì)算得來的?
回復(fù)

使用道具 舉報(bào)

18#
ID:979299 發(fā)表于 2021-12-24 10:40 | 只看該作者
請教CheckValue = P3&0x32;//按鍵接在p3.1 p3.4 p3.5這個(gè)是怎么計(jì)算得來的?

在這里不是按位與運(yùn)算,是直接取地址,0x32就是給這幾個(gè)端口賦值1。程序中直接位定義不行嗎
回復(fù)

使用道具 舉報(bào)

19#
ID:140489 發(fā)表于 2021-12-24 12:50 | 只看該作者
寫兩個(gè)數(shù)組就能搞定的事,不要寫的那么麻煩
  1. #include <REG52.H>


  2. unsigned int code tab[]={0XFE,0XFD,0XFB,0XF7,0XEF,0XDF,0XBF,0X7F,0XFF};
  3. unsigned int code tab1[]={0X7F,0XBF,0XDF,0XEF,0XF7,0XFB,0XFD,0XFE,0XFF};
  4. //**********************************System Fuction*************************************************
  5. void Delay1ms(unsigned int count)
  6. {
  7.         unsigned int i,j;
  8.         for(i=0;i<count;i++)
  9.         for(j=0;j<120;j++);
  10. }


  11. //***********************************************************************************
  12. main()
  13. {


  14.                 unsigned char cont;
  15.         unsigned char i;

  16.     while(1)
  17.     {
  18. /////////////////////////////
  19.                 switch(cont)
  20.                 {
  21.                         case 0:         for(i=0; i<9; i++)
  22.                         {
  23.                                 P0=tab[i];
  24.                                 Delay1ms(200);
  25.                                 if(i==7)
  26.                                         cont=1;                               
  27.                         }  break;

  28.                         case 1:         for(i=0; i<9; i++)
  29.                         {
  30.                                 P2=tab[i];
  31.                                 Delay1ms(200);
  32.                                 if(i==7)
  33.                                         cont=2;                               
  34.                         }  break;

  35.                         case 2:         for(i=0; i<9; i++)
  36.                         {
  37.                                 P1=tab[i];
  38.                                 Delay1ms(200);
  39.                                 if(i==7)
  40.                                         cont=3;                               
  41.                         }  break;
  42.                         case 3:         for(i=0; i<9; i++)
  43.                         {
  44.                                 P1=tab1[i];
  45.                                 Delay1ms(200);
  46.                                 if(i==7)
  47.                                         cont=4;                               
  48.                         }  break;
  49.                         case 4:         for(i=0; i<9; i++)
  50.                         {
  51.                                 P2=tab1[i];
  52.                                 Delay1ms(200);
  53.                                 if(i==7)
  54.                                         cont=5;                               
  55.                         }  break;
  56.                         case 5:         for(i=0; i<9; i++)
  57.                         {
  58.                                 P0=tab1[i];
  59.                                 Delay1ms(200);
  60.                                 if(i==7)
  61.                                         cont=0;                               
  62.                         }  break;


  63.                         default: break;
  64.                 }
  65.         }
  66. }
復(fù)制代碼


回復(fù)

使用道具 舉報(bào)

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

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 精品少妇一区二区三区在线播放 | 久久91| 亚洲天堂中文字幕 | 国产视频福利在线观看 | 精品国产乱码久久久久久88av | 亚洲精品一区二区网址 | 亚洲一区二区中文字幕在线观看 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 成人av片在线观看 | 成人国产一区二区三区精品麻豆 | 日韩乱码在线 | 久久久无码精品亚洲日韩按摩 | 成人精品鲁一区一区二区 | 欧美精品一区二区三区在线播放 | 国产综合网站 | 国产精品99久久久精品免费观看 | 成人综合视频在线 | 91精品久久久久 | 日本黄色短片 | 亚洲一区二区电影在线观看 | 欧美日韩网站 | 2018天天干天天操 | 日韩有码一区二区三区 | 九九九久久国产免费 | 97av在线| 欧美日韩一 | 久夜精品| 日本不卡视频在线播放 | 成人欧美一区二区三区白人 | 九九亚洲 | 欧美二区三区 | 亚洲网站在线播放 | 天堂一区二区三区 | 7777奇米影视 | 久久精品国产99国产精品 | 一区二区三区在线播放 | 国产精品久久久久久久久久久久久 | 污书屋 | 久久久无码精品亚洲日韩按摩 | 亚洲精品一级 | 欧美一级三级在线观看 |