By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

how to fix the error for this program

P: 5
#include <REGX51.H>
#include "delay.h"
#include "lcd.h"
#include "keypad.h"

#define relay P1_7;
void main()
{
int first_key,second_key,third_key,fourth_key;
P1=0X00;

P2=0x00;
P3=0xff;
LCD_INIT();

LCD_STRING("PASSWORD BASED");
delay_sec(1);
LCD_CMD(PUTLINE2);
LCD_STRING("LOCKING SYSTEM");

LCD_CLEAR();
LCD_STRING("ENTER PASSWORD:");
delay_sec(1);
LCD_CLEAR();
while(key_get()==NOKEY);
first_key=key;
LCD_STRING("*");


while(key_get()==NOKEY);
second_key=key;
LCD_STRING("*");


while(key_get()==NOKEY);
third_key=key;
LCD_STRING("*");


while(key_get()==NOKEY);
fourth_key=key;
LCD_STRING("*");

while(1)
{
if((first_key==1)&&(second_key==2)&&(third_key==3) &&(fourth_key==4))
{
LCD_CLEAR();
LCD_STRING("Correct Password");
P1_2=1;
delay_sec(2);
}
else
{
LCD_CLEAR();
LCD_STRING("Incorrect Password");
delay_sec(2);
}

} }
this is the output
xc.c(3): warning C318: can't open file 'lcd.h'
xc.c(4): warning C318: can't open file 'keypad.h'
XC.C(14): warning C206: 'LCD_INIT': missing function-prototype
XC.C(16): warning C206: 'LCD_STRING': missing function-prototype
XC.C(16): error C267: 'LCD_STRING': requires ANSI-style prototype
Target not created
May 1 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.