I have problem when compiler this code, can anyone help me?
I use keil software.. This is the problem that i got
Build target 'Target 1'
compiling My.c...
My.c(2): warning C318: can't open file 'lcddisplay.h'
My.c(16): warning C206: 'lcd_init': missing function-prototype
My.c(17): warning C206: 'lcdcmd': missing function-prototype
My.c(17): error C267: 'lcdcmd': requires ANSI-style prototype
Target not created.
This is my code..
#include<reg51.h>
#include"lcddisplay.h"
#include<intrins.h>
sbit rd = P2^0;
sbit wr = P2^1;
sbit intr = P2^2;
sbit finger = P2^5;
sbit buz = P2^3;
#define adcdata P3
void convert(unsigned char );
unsigned char a,pp=0,count=0,i;
void main()
{
buz=0;
finger=1;
lcd_init();
lcdcmd(0x85);
msgdisplay("WELCOME");
lcdcmd(0x01);
msgdisplay("temp hbeat");
rd=1;
intr=1;
adcdata=0xff;
while(1)
{
lcdcmd(0xc2);
//delay(500);
wr=0;
_nop_();
_nop_();
_nop_();
_nop_();
wr=1;
delay(50);
rd=0;
delay(10);
a=adcdata;
convert(a);
delay(500);
for(i=0;i<100;i++)
{
count+=1;
if(finger==0)
{
delay(1000);
if(!finger)
{
buz=1;
delay(500);
pp=1;
buz=0;
break;
}
else
pp=0;
}
}
delay(500);
lcdcmd(0xca);
if(pp)
{
convert(count);
}
else
convert(0);
pp=0;
}
}
void convert(unsigned char temp_value)
{
unsigned char value,d1,d2,d3;
temp_value = temp_value;
value=temp_value/10;
d3=temp_value%10;
d1=value/10;
d2=value%10;
d1=d1+0x30;
lcddata(d1);
delay(10);
d2=d2+0x30;
lcddata(d2);
delay(4);
// msgdisplay(".");
d3=d3+0x30;
lcddata(d3);
delay(10);
}
Can anyone help me to fix the code?
I use keil software.. This is the problem that i got
Build target 'Target 1'
compiling My.c...
My.c(2): warning C318: can't open file 'lcddisplay.h'
My.c(16): warning C206: 'lcd_init': missing function-prototype
My.c(17): warning C206: 'lcdcmd': missing function-prototype
My.c(17): error C267: 'lcdcmd': requires ANSI-style prototype
Target not created.
This is my code..
#include<reg51.h>
#include"lcddisplay.h"
#include<intrins.h>
sbit rd = P2^0;
sbit wr = P2^1;
sbit intr = P2^2;
sbit finger = P2^5;
sbit buz = P2^3;
#define adcdata P3
void convert(unsigned char );
unsigned char a,pp=0,count=0,i;
void main()
{
buz=0;
finger=1;
lcd_init();
lcdcmd(0x85);
msgdisplay("WELCOME");
lcdcmd(0x01);
msgdisplay("temp hbeat");
rd=1;
intr=1;
adcdata=0xff;
while(1)
{
lcdcmd(0xc2);
//delay(500);
wr=0;
_nop_();
_nop_();
_nop_();
_nop_();
wr=1;
delay(50);
rd=0;
delay(10);
a=adcdata;
convert(a);
delay(500);
for(i=0;i<100;i++)
{
count+=1;
if(finger==0)
{
delay(1000);
if(!finger)
{
buz=1;
delay(500);
pp=1;
buz=0;
break;
}
else
pp=0;
}
}
delay(500);
lcdcmd(0xca);
if(pp)
{
convert(count);
}
else
convert(0);
pp=0;
}
}
void convert(unsigned char temp_value)
{
unsigned char value,d1,d2,d3;
temp_value = temp_value;
value=temp_value/10;
d3=temp_value%10;
d1=value/10;
d2=value%10;
d1=d1+0x30;
lcddata(d1);
delay(10);
d2=d2+0x30;
lcddata(d2);
delay(4);
// msgdisplay(".");
d3=d3+0x30;
lcddata(d3);
delay(10);
}
Can anyone help me to fix the code?