Home > Back-end >  The main c (199) : error C237: 'display' : the function already has a body
The main c (199) : error C237: 'display' : the function already has a body

Time:09-18

#include
# define uchar unsigned char
# define uint unsigned int
Uchar code
TAB [10]={x5b x3f 0, 0 x06, 0, 0 x4f, 0 x66, 0 x6d, 0 x7d, 0 x07, 0 x7f, 0 x6f};
Float f;
Uchar sg, ss, bai, shi, gei, XSL, xs2, tt, ii;
P1 sbit ds=^ 1;
Sbit weed=P3 ^ 0;
Sbit dued=P3 ^ 1;
Sbit xeed=P3 ^ 4;
Sbit hh=P3 ^ 2;
Sbit hh1=P3 ^ 3;
Sbit pp=p ^ 2;
Sbit pp1=P2 ^ 0;
Void the 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;
The date=0;
for(k=0; K<8; K++)
{
The date=date> 1;
Ds=0;
i++;
Ds=1;
i++;
I=1;
While (I);
If (ds==1)
The date=date | 0 x80;
The else date=date | 0 x00;
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& 0 x01;
The date=date> 1;
If (x1)
{
Ds=0;
i++;
Ds=1;
i++;
I=10;
While (I);
Ds=1;
}
The else
{
Ds=0;
i++;
I=10;
While (I);
Ds=1;
}
}
}

Void redtemp ()
{
Uchar templ temph;
Uint temp.
if(! Chu18b20 ())
{
Writeds18b20 (0 XCC);
The xbe writeds18b20 (0);
Templ=redds18b20 ();
Temph=redds18b20 ();
The display ();
Temph=temph& 0 x07;//????????
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 & gt;
=5)XSL=(zz/10) % 10 + 1;
The else XSL=(zz/10) % 10;
}
Void qidong18b20 ()
{
if(! Chu18b20 ())
{
Writeds18b20 (0 XCC);
X44 writeds18b20 (0);
}
}
Void the display ()
{
Chuli ();
Weed=1;
P0=0 xfe;
Weed=0;
Dued=1;
P0=TAB (XSL);
Dued=0;
Dely (1);
Dued=1;
P0=0 x00;
Dued=0;
Weed=1;
P0=0 XFD;
Weed=0;
Dued=1;
P0=TAB (gei) | 0 x80;
Dued=0;
Dely (1);
Dued=1;
P0=0 x00;
Dued=0;
Weed=1;
P0=0 XFB;
Weed=0;
Dued=1;
P0=TAB (shi);
Dued=0;
Dely (1);
Dued=1;
P0=0 x00;
Dued=0;
Weed=1;
P0=0 xef;
Weed=0;
Dued=1;
P0=TAB [0];
Dued=0;
Dely (1);
Dued=1;
P0=0 x00;
Dued=0;
Weed=1;
XDF P0=0;
Weed=0;
Dued=1;
P0=TAB (sg) | 0 x80;
Dued=0;
Dely (1);
Dued=1;
P0=0 x00;
Dued=0;
Weed=1;
XBF P0=0;
Weed=0;
Dued=1;
P0=TAB (ss);
Dued=1;
Dely (1);
P0=0 x00;
Dued=0;
}

Void the display (uint a)
{
Uint x, y;
For (x=a; X> 0; X -);
For (y=122; Y> 0; Y -);
}
Void chu52 ()
{
Pp1=0;
TMOD=0 x01;
TH0=0 x3c;
TL0=0 xb0;
P1=0 XFF;
Sg=0;
Ss=7.
ET0=1;
EA=1;
F=70;
TR0=1;
Tt=0;
}

Void timer0 (void) interrupt 1
{
TH0=0 x3c;
TL0=0 xb0;
tt++;
If (tt==20)
{
Tt=0;
Redtemp ();
The display ();
Qidong18b2 ();
}
}
Void anjian ()
{
If (hh==0)
For (ii=0; Ii<12. Ii++)
The display ();
If (hh==0)
{
Sg=sg + 1;
If (sg==10)
Sg=0;
}
If (hh1==0)
For (ii=0; Ii<12. Ii++)
The 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>=the fs)
{
Pp=1;
If (f - fs>
=5)Pp1=1;
The else pp1=0;
}
If (f{
Pp=0;
Pp1=0;
}
The display ();
Anjisn ();
}
}

CodePudding user response:

Have any big save me, want to half a day, just a mistake,

CodePudding user response:

The void display (uint a)
To void dely (uint a)

CodePudding user response:

The main () function at the end of the

 display (); 
Anjian ();//-- -- -- -- -- -- -- -- anjisn () instead of anjian () -- -- -- -- -- --

In the main () function code on top of the
 void dely (uint a) \ \ -- -- -- -- -- change the display to dely -- -- -- -- -- 
{
Uint x, y;
For (x=a; X> 0; X -);


  • Related