找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2961|回复: 2
收起左侧

error C141: syntax error near 'sbit'怎么修改啊

[复制链接]
ID:777780 发表于 2020-6-13 00:19 | 显示全部楼层 |阅读模式
1黑币
uchar i;
while(ms--)
{
for(i=0;i<123;i++);
}
}
void Timer0() interrupt 1
{
TH0= (65535-50000)/256;
TL0=(65535-50000)%256;
if(fIR==0)
{
if(++times==SetTime)  
{
times = 0;
TR0=0;
LAMP=1;
}
}
}
void main(void)
{
P2=0xff;P3=0xff;P1=0xff;
SetTime=SetSecond*20;
TMOD = 0x01;
TH0=(65535-50000)/256;
TL0=(65535-50000)%256;
EA=1;
ET0=1;
TR0=0;
while(1)
{
if(IR==0)
{
delayms(20);
if(IR==0)
  {
fIR=1;TR0=1;
LAMP=0;
}
}
else fIR=0;
}
}
Build target 'Target 1'
compiling hhh.c...
HHH.C(12): error C141: syntax error near 'sbit'
HHH.C(12): error C202: 'IR': undefined identifier
HHH.C(12): error C202: 'i': undefined identifier
HHH.C(15): error C202: 'i': undefined identifier
HHH.C(44): error C202: 'IR': undefined identifier
HHH.C(47): error C202: 'IR': undefined identifier
Target not created

回复

使用道具 举报

ID:155507 发表于 2020-6-15 10:03 | 显示全部楼层
需要加入头文件

#include <reg52.h>
回复

使用道具 举报

ID:780424 发表于 2020-6-15 23:07 | 显示全部楼层
#include <reg51.h>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表