This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

programming is howing error

i am working on a project for the automatic power reading using gsm
but getting some errors:
please check the program and guide me

Build target 'Target 1'
compiling codec.c...
codec.c(2): warning C318: can't open file 'lcd.h'
codec.c(3): warning C318: can't open file 'rtc.h'
codec.c(5): warning C318: can't open file 'bcd2ascii.h'
codec.c(6): warning C318: can't open file 'serial.h'
CODEC.C(35): warning C206: 'lcdInit': missing function-prototype
CODEC.C(36): warning C206: 'LCDstr': missing function-prototype
CODEC.C(36): error C267: 'LCDstr': requires ANSI-style prototype
Target not created

#include<reg52.h>
#include <lcd.h>
#include <rtc.h>
#include<string.h>
#include<bcd2ascii.h>
#include<serial.h>

sbit sw1=P3^7;
sbit sw2=P3^6;
sbit sw3=P3^5;
sbit buzzer=P2^3;
sbit relay=P2^2;
sbit rled =P3^4;
sbit gled =P3^3;
bit flag_sw,flagr=0;

static unsigned char k=0,s=0x84,*result,h,unit=0;
unsigned char inc=23,check_flag=0,month_flag=0,month;
unsigned char *time,*res;
unsigned char idata byte1[100];
unsigned char *date,*u,i,j,a=0,b,c,d;

void main()
{ TMOD=0x20; // serial communication intialization
TH1=0XFD;SCON=0X50;TR1=1;i=0;
IE=0X91;IT0=0;

lcdInit(); // LCD intialization
LCDstr("AUTOMATIC POWER",0x80);
LCDstr("METER READING",0xc0);
delay(2000);

gsm_check();gsm_rec(); //gsm modem intialization
gled=0;rled=1;buzzer=1;relay=1;

while(1) //super loop
{

//time display
LCDstr("DATE ",0x80);
LCDstr("TIME",0xc0);
date=getDate();
LCDstr(date,0x86);
time=getTime();
LCDstr(time,0xc6);
flag_sw=0;delay(1000);

//units display
putComL(0x01);
LCDstr("UNITS=",0x80);
putComL(0x86);
unit=getCharE(0x15);
u=bcdtoascii(unit);
LCDstr(u,0x87);

delay(2000);

/**************checking********************/

a=getCharE(0x04); // gsm modem sending sms
if(a>=28 )
{ gsm_check();
delay(200);
ES=0;
unit=0;
putCharE(unit,0x15);
rled=0;gled=1;
gsm_send(byte,"number"); }

//else case

if(a>=16 & d==c){month_flag=1;}
else month_flag=0;month_flag=getCharE(0x20);

if(check_flag==0 & month_flag==1 &flagr==0){flagr=1;relay=0;rled=0;gled=1;buzzer=0;delay(100);buzzer=1;}
else if(check_flag==1 ){ gled=0;rled=1;buzzer=1;relay=1;} delay(1000);

//receving sms
for(j=0;j<100;j++) {if(byte1[j]=='*' &byte1[j+1]=='P' & byte1[j+2]=='A'& byte1[j+3]=='I'& byte1[j+4]=='D') {ES=0;LCDstr("received",0xc0); a=1;check_flag=1;putCharE(check_flag,0x10); gsm_rec(); }} //time setting

if(sw3==0){enter_time();}
delay(1000);k=0;

}}

Please Guide Me...

Parents
  • If you have written code with:

    lcdInit(); // LCD intialization
    LCDstr("AUTOMATIC POWER",0x80);
    LCDstr("METER READING",0xc0);
    


    Then you must have picked up that "lcdInit()" or "LCDstr()" somewhere.

    That would be the place where you can also find the header files required.

    Unless you have only seen partial code somewhere and cut/pasted without checking what you had access to. Then you have to start from scratch and write all functions for LCD access. Or go find other code to use instead.

    But how about you start looking at the same place you originally "found" lcdInit() and LCDstr()...

    And please - do stay in one (1) thread. New threads don't give you more answers. They only make people irritated - and irritated people tends to ignore things that irritates them.

Reply
  • If you have written code with:

    lcdInit(); // LCD intialization
    LCDstr("AUTOMATIC POWER",0x80);
    LCDstr("METER READING",0xc0);
    


    Then you must have picked up that "lcdInit()" or "LCDstr()" somewhere.

    That would be the place where you can also find the header files required.

    Unless you have only seen partial code somewhere and cut/pasted without checking what you had access to. Then you have to start from scratch and write all functions for LCD access. Or go find other code to use instead.

    But how about you start looking at the same place you originally "found" lcdInit() and LCDstr()...

    And please - do stay in one (1) thread. New threads don't give you more answers. They only make people irritated - and irritated people tends to ignore things that irritates them.

Children