51单片机报错找不到原因main.c(6): error C141: syntax error near 'sbit', expected 'hdata',之前的文件用sbit这个是可以实现的,正常不懂为什么报错,请指出问题
#include
#include "Delay.h"
#include "LCD1602.h"
#include "Int0.h"
unsigned char count;
sbit LED=P2^0;
char count=1;
void main()
{
Int0_Init();
while(1){
if(count==1){
LED=~LED;
Delay1000ms();
}
else{
LED=1;
}
}
}
void Into0_Routine(void) interrupt 0
{
count=~count;
}
你看看引用的头文件是否正常
一般是网上复制下来的代码,在中间有非C语言标识符。把这句程序删掉,重新手动输入一下试试。
问题很可能在你那几个头文件里。
另外,
unsigned char count;
sbit LED=P2^0;
char count=1;
count重复定义了