C(84): warning C209: 'hextobcd': too few actual parameters,用keil编程序之后运行出现的错误,求帮助
#include"reg52.h"#include"intrins.h"#include"math.h"#defineucharunsignedchar#defineui...
#include"reg52.h"
#include"intrins.h"
#include"math.h"
#define uchar unsigned char
#define uint unsigned int
#define Lcd_Data P0
uchar code dispbuf[33]={"Temperature: `CDistance: mm"};
uchar numcode[10]={'0','1','2','3','4','5','6','7','8','9'};
uint num[29]={0};
uchar jsh,jsl;
uchar count=0;
uint distance;
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
sbit Busy=P0^7;
uchar bdata flag;
sbit DQ=P2^7;
uint temp;
void delay(void);
void Init_LCD(void);
void Write_Comm(uchar);
void Write_Data(uchar);
void Read_Busy(void);
void Init_18B20(void);
uchar ReadOneChar(void);
void WriteOneChar(uchar dat);
void testtemp(void);
uint wd(void);
void Delay(uint time);
sbit sta_flag=flag^0;
sbit fuhao=flag^1;
sbit START=P1^0;
sbit CNT=P2^5;
sbit CSBIN=P2^6;
sbit BUZZER=P3^7;
void timer1(void);
void delay1ms(void);
void sys_init(void);
void display(void);
void computer(void);
void hextobcd(bit flag,uchar num);
void bm(void);
void delay15(uchar us);
void main(void)
{
uchar i,j;
for(i=0;i<255;i++)
for(j=0;j<255;j++);
sys_init();
display();
sta_flag=0;
waitforstarting:
while(START);
for(i=0;i<20;i++)
delay1ms();
if(START)
goto waitforstarting;
BUZZER=0;
i=100000;
while(i--);
BUZZER=1;
i=100000;
while(i--);
TR0=1;
ET0=1;
testtemp();
while(1)
{
if(sta_flag)
{
while(0==CSBIN);
TR1=0;
jsh=TH1;
jsl=TL1;
if(15==count)
{
temp=wd();
count=0;
testtemp();
display();
}
computer();
hextobcd();
sta_flag=0;
}
}
}
这里的报错是:1.C(84): warning C209: 'hextobcd': too few actual parameters
void hextobcd(void)
{
float tp;
unsigned long int tmp;
fuhao=0;
if(temp<0x8000)
tp=temp*0.0625;
else
{
bm();
tp=temp*0.0625;
fuhao=1;
}
tp*=10;
tmp=tp;
num[12]=tmp/100;
if(fuhao)
num[12]=num[12]|0x80;
num[13]=tmp/10-(tmp/100)*10;
tmp=distance;
num[25]=tmp/1000;
tmp%=1000;
num[26]=tmp/100;
tmp%=100;
num[27]=tmp/10;
tmp%=10;
num[28]=tmp/1;
}
void testtemp(void)
{
Init_18B20();
if(flag)
{
WriteOneChar(0xCC);
WriteOneChar(0x44);
}
}
这里的报错是:C(152): error C236: 'hextobcd': different length of parameter lists
求帮助呀,急需,谢谢各位了!!! 展开
#include"intrins.h"
#include"math.h"
#define uchar unsigned char
#define uint unsigned int
#define Lcd_Data P0
uchar code dispbuf[33]={"Temperature: `CDistance: mm"};
uchar numcode[10]={'0','1','2','3','4','5','6','7','8','9'};
uint num[29]={0};
uchar jsh,jsl;
uchar count=0;
uint distance;
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
sbit Busy=P0^7;
uchar bdata flag;
sbit DQ=P2^7;
uint temp;
void delay(void);
void Init_LCD(void);
void Write_Comm(uchar);
void Write_Data(uchar);
void Read_Busy(void);
void Init_18B20(void);
uchar ReadOneChar(void);
void WriteOneChar(uchar dat);
void testtemp(void);
uint wd(void);
void Delay(uint time);
sbit sta_flag=flag^0;
sbit fuhao=flag^1;
sbit START=P1^0;
sbit CNT=P2^5;
sbit CSBIN=P2^6;
sbit BUZZER=P3^7;
void timer1(void);
void delay1ms(void);
void sys_init(void);
void display(void);
void computer(void);
void hextobcd(bit flag,uchar num);
void bm(void);
void delay15(uchar us);
void main(void)
{
uchar i,j;
for(i=0;i<255;i++)
for(j=0;j<255;j++);
sys_init();
display();
sta_flag=0;
waitforstarting:
while(START);
for(i=0;i<20;i++)
delay1ms();
if(START)
goto waitforstarting;
BUZZER=0;
i=100000;
while(i--);
BUZZER=1;
i=100000;
while(i--);
TR0=1;
ET0=1;
testtemp();
while(1)
{
if(sta_flag)
{
while(0==CSBIN);
TR1=0;
jsh=TH1;
jsl=TL1;
if(15==count)
{
temp=wd();
count=0;
testtemp();
display();
}
computer();
hextobcd();
sta_flag=0;
}
}
}
这里的报错是:1.C(84): warning C209: 'hextobcd': too few actual parameters
void hextobcd(void)
{
float tp;
unsigned long int tmp;
fuhao=0;
if(temp<0x8000)
tp=temp*0.0625;
else
{
bm();
tp=temp*0.0625;
fuhao=1;
}
tp*=10;
tmp=tp;
num[12]=tmp/100;
if(fuhao)
num[12]=num[12]|0x80;
num[13]=tmp/10-(tmp/100)*10;
tmp=distance;
num[25]=tmp/1000;
tmp%=1000;
num[26]=tmp/100;
tmp%=100;
num[27]=tmp/10;
tmp%=10;
num[28]=tmp/1;
}
void testtemp(void)
{
Init_18B20();
if(flag)
{
WriteOneChar(0xCC);
WriteOneChar(0x44);
}
}
这里的报错是:C(152): error C236: 'hextobcd': different length of parameter lists
求帮助呀,急需,谢谢各位了!!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询