標(biāo)題: 急急 [打印本頁(yè)]

作者: hadesi    時(shí)間: 2013-11-6 13:33
標(biāo)題: 急急
請(qǐng)教各位大神,我程序錯(cuò)在哪里?
#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
#define  p1
#define         LED
sbit LED = p1^0;
void DelayMS(uint x )
{   uchar i;
    while (x--)
        {for(i=120;i>0;i--);}
}
void main()
{ LED = 0;
  while(1)
  {
    LED=~LED;
          DelayMS(150);
        }
}錯(cuò)誤提示為

一位閃燈.C(1): warning C500: MISSING LICENSE ID CODE (LIC) IN 'TOOLS.INI'
一位閃燈.C(6): error C141: syntax error near '<', expected '<id>'
一位閃燈.C(10): error C129: missing ';' before '>'是什么意思?


作者: liaolinhui    時(shí)間: 2014-1-4 00:18
本帖最后由 liaolinhui 于 2014-1-4 00:25 編輯

#define  p1
#define         LED
這兩句好像有問(wèn)題,宏定義不完整,還有while(x--)貌似也用錯(cuò)了,我也是這兩天才學(xué)單片機(jī),有說(shuō)得不對(duì)的大家也指點(diǎn)我一下




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1