main.c(199): error C237: 'display': function already has a body

LAN929131485 LAN929131485 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code
tab[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
float f;
uchar sg,ss,bai,shi,gei,xsl,xs2,tt,ii;
sbit ds=P1^1;
sbit weed=P3^0;
sbit dued=P3^1;
sbit xeed=P3^4;
sbit hh=P3^2;
sbit hh1=P3^3;
sbit pp=P1^2;
sbit pp1=P2^0;
void display();
void dely(uint a);
bit chu18b20()
{
uint i;
bit x;
x=1;
ds=1;
i++;
ds=0;
i=100;
while(--i);
ds=1;
i=6;
while(--i);
x=ds;
i=10;
while(--i);
return(x);
}

uchar redds18b20()
{
uint i;
uchar date,k;
date=0;
for(k=0;k<8;k++)
{
date=date>>1;
ds=0;
i++;
ds=1;
i++;
i=1;
while(--i);
if(ds==1)
date=date|0x80;
else date=date|0x00;
i=10;
while(--i);
}

return(date);
}

void writeds18b20(uchar date)
{
uchar temp,k;
bit x1;
uint i;
for(k=0;k<8;k++)
{
temp=date;
x1=temp&0x01;
date=date>>1;
if(x1)
{
ds=0;
i++;
ds=1;
i++;
i=10;
while(--i);
ds=1;
}
else
{
ds=0;
i++;
i=10;
while(--i);
ds=1;
}
}
}

void redtemp()
{
uchar templ,temph;
uint temp;
if(!chu18b20())
{
writeds18b20(0xcc);
writeds18b20(0xbe);
templ=redds18b20();
temph=redds18b20();
display();
temph=temph&0x07; //??????
temp=temph<<8;
temp=temp|templ;
f=temp*0.0625;
}
}

void chuli()
{
uint zz;
zz=f*100;
bai=zz/10000;
shi=(zz/1000)%10;
gei=(zz/100)%10;
xs2= zz%10;
if(xs2>=5)
xsl=(zz/10)%10+1;
else xsl=(zz/10)%10;
}
void qidong18b20()
{
if(!chu18b20())
{
writeds18b20(0xcc);
writeds18b20(0x44);
}
}
void display()
{
chuli();
weed=1;
P0=0xfe;
weed=0;
dued=1;
P0=tab[xsl];
dued=0;
dely(1);
dued=1;
P0=0X00;
dued=0;
weed=1;
P0=0Xfd;
weed=0;
dued=1;
P0=tab[gei]|0x80;
dued=0;
dely(1);
dued=1;
P0=0X00;
dued=0;
weed=1;
P0=0xfb;
weed=0;
dued=1;
P0=tab[shi];
dued=0;
dely(1);
dued=1;
P0=0X00;
dued=0;
weed=1;
P0=0xef;
weed=0;
dued=1;
P0=tab[0];
dued=0;
dely(1);
dued=1;
P0=0X00;
dued=0;
weed=1;
P0=0Xdf;
weed=0;
dued=1;
P0=tab[sg]|0x80;
dued=0;
dely(1);
dued=1;
P0=0X00;
dued=0;
weed=1;
P0=0Xbf;
weed=0;
dued=1;
P0=tab[ss];
dued=1;
dely(1);
P0=0X00;
dued=0;
}

void display(uint a)
{
uint x,y;
for(x=a;x>0;x--);
for(y=122;y>0;y--);
}
void chu52()
{
pp1=0;
TMOD=0X01;
TH0=0X3C;
TL0=0XB0;
P1=0xff;
sg=0;
ss=7;
ET0=1;
EA=1;
f=70;
TR0=1;
tt=0;
}

void timer0(void)interrupt 1
{
TH0=0X3C;
TL0=0XB0;
tt++;
if(tt==20)
{
tt=0;
redtemp();
display();
qidong18b2();
}
}
void anjian()
{
if(hh==0)
for(ii=0;ii<12;ii++)
display();
if(hh==0)
{
sg=sg+1;
if(sg==10)
sg=0;
}
if(hh1==0)
for(ii=0;ii<12;ii++)
display();
if(hh1==0)
{
ss=ss+1;
if(ss==10)
ss=0;
}
}

void main()
{
chu52();
qidong18b20();
while(1);
{
float fs;
fs=ss*10+sg;
if(f>=fs)
{
pp=1;
if(f-fs>=5)
pp1=1;
else pp1=0;
}
if(f<fs)
{
pp=0;
pp1=0;
}
display();
anjisn();
}
}
...全文

相关推荐

keil c语言编程常见错误分析.doc

c:\8051 的工作目录中四、 Error 237: ’LedOn’: function already has a body* 说明:LedOn() 函数名称重复定义,即有两个以上一样的函数名称*

omyligaga

c语言中常见的错误

Cannot modify a const object in function main**问题描述**:尝试修改在`main`函数中声明的常量对象。

wojiaokangjian

__FILE__,__LINE__,FUNCTION__实现代码跟踪调试(linux下c语言编程 )

`__FUNCTION__` 宏(C99及更高版本): 在C99标准及以后的版本中,`__FUNCTION__` 返回当前函数的名称作为一个字符串常量。

zhenwenxian

c语言编译常见错误列表

#### 4. code has no effect in function main如果某段代码对程序的实际运行结果没有任何影响,就会出现此警告。

lk123456sc

Agentic o3与推理优化模型:本地可部署AI智能体落地实践

智能体(Agent)作为大模型应用的关键范式,其工程化落地依赖于可验证的状态机协议与硬件亲和的推理优化模型。Agentic o3首次定义了plan/act/reflect三阶段标准化接口,赋予Agent可观测性与可调试性;而Gemma 3、Nemotron-H等离线推理优化模型通过定制量化、确定性计算与NPU/Tensor Core协同设计,解决了资源受限场景下的稳定性、延迟与功耗瓶颈。二者结合,使轻量级AI智能体可在MacBook、Jetson、树莓派等边缘设备上实现秒级响应、断点续跑与审计追踪。本文聚焦

weixin_30254435
评论 3
收藏 已收藏
分享
返回顶部