找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1611|回復: 3
收起左側(cè)

求大神幫我改改有警告

[復制鏈接]
ID:302902 發(fā)表于 2018-4-6 21:16 | 顯示全部樓層 |閱讀模式
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  _DELAY
    MODULE:  zy.obj (ZY)
    ADDRESS: 0A3AH

  1. #include<reg51.h>
  2. #define LED P1
  3. void delay( int x);
  4. main()
  5. {
  6.         unsigned  char   i,j;
  7.     unsigned char dis1[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
  8.         unsigned char dis2[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
  9.         unsigned char dis3[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00};
  10.         unsigned char dis4[]={0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe};
  11.         unsigned char dis5[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};
  12.         unsigned char dis6[]={0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f};
  13.         unsigned char dis7[]={0xe7,0xdb,0xbd,0x7e,0x7e,0xbd,0xdb,0xe7};
  14.         unsigned char dis8[]={0xf0,0x0f,0xf0,0x0f,0xf0,0x0f,0xf0,0x0f};
  15.         unsigned char dis9[]={0x3f,0xcf,0xf3,0xfc,0xfc,0xf3,0xcf,0x3f};
  16.         unsigned char dis10[]={0x33,0xcc,0x33,0xcc,0x33,0xcc,0x33,0xcc};
  17.         while(1)
  18.   {
  19.         for(j=0;j<2;j++)
  20.         {
  21.         for(i=0;i<8;i++)
  22.          {
  23.           LED=dis1[i];
  24.           delay(100);
  25.          }
  26.         }
  27.         for(j=0;j<3;j++)
  28.         {
  29.         for(i=0;i<8;i++)
  30.          {
  31.           LED=dis2[i];
  32.           delay(100);
  33.          }
  34.         }
  35.         for(j=0;j<4;j++)
  36.         {
  37.         for(i=0;i<8;i++)
  38.          {
  39.           LED=dis3[i];
  40.           delay(100);
  41.          }
  42.         }
  43.         for(j=0;j<2;j++)
  44.         {
  45.         for(i=0;i<8;i++)
  46.          {
  47.           LED=dis4[i];
  48.           delay(100);
  49.          }
  50.         }
  51.         for(j=0;j<3;j++)
  52.         {
  53.         for(i=0;i<8;i++)
  54.          {
  55.           LED=dis5[i];
  56.           delay(100);
  57.          }
  58.         }
  59.         for(j=0;j<4;j++)
  60.         {
  61.         for(i=0;i<8;i++)
  62.          {
  63.           LED=dis6[i];
  64.           delay(100);
  65.          }
  66.         }
  67.         for(j=0;j<2;j++)
  68.         {
  69.         for(i=0;i<8;i++)
  70.          {
  71.           LED=dis7[i];
  72.           delay(100);
  73.          }
  74.         }
  75.         for(j=0;j<3;j++)
  76.         {
  77.         for(i=0;i<8;i++)
  78.          {
  79.           LED=dis8[i];
  80.           delay(100);
  81.          }
  82.         }
  83.         for(j=0;j<4;j++)
  84.         {
  85.         for(i=0;i<8;i++)
  86.          {
  87.           LED=dis9[i];
  88.           delay(100);
  89.          }
  90.         }
  91.         for(j=0;j<2;j++)
  92.         {
  93.         for(i=0;i<8;i++)
  94.          {
  95.           LED=dis10[i];
  96.           delay(100);
  97.          }
  98.         }
  99.   }
  100. }
復制代碼


回復

使用道具 舉報

ID:302953 發(fā)表于 2018-4-6 22:50 | 顯示全部樓層
這個是單片機?表示不是很懂編程
回復

使用道具 舉報

ID:287575 發(fā)表于 2018-4-6 23:02 | 顯示全部樓層
把delay(int x) 的實體寫上,
比如在后邊加上
void delay(int x)
{
        while(--x);
}
就可以了,沒警告了

評分

參與人數(shù) 1黑幣 +20 收起 理由
admin + 20 回帖助人的獎勵!

查看全部評分

回復

使用道具 舉報

ID:303083 發(fā)表于 2018-4-7 12:17 | 顯示全部樓層
警告信息可以貼出來
回復

使用道具 舉報

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

本版積分規(guī)則

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

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

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