Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with delay.h and lcd.h for keil programming

Status
Not open for further replies.

adambose1990

Newbie level 4
Joined
Oct 7, 2011
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Kolkata, India
Activity points
1,389
This is a program of a digital clock using 89s52

#include "REGX52.H"
#include "delay.h"
#include "lcd.h"
void main(void)
{
int hr=0; /*initiate hour=0 */
int min=0; /*initiate minutes=0 */
int sec=0; /*initiate seconds=0 */
P1=0xff; /*set port 1 as input port */
P2=0x00; /*set port 2 as output port*/
while(1)
{ LCD_INIT(); /*initialize LCD*/
if (P1_4==0)/*if P1_4 is grounded enter the 12hr loop */
{
for (sec=0;sec<60;sec )
{
LCD_DisplayNum(hr,2);
LCD_STRING(":");
LCD_DisplayNum(min,2);
LCD_STRING(":");
LCD_DisplayNum(sec,2);
LCD_STRING(" (12 HR)");
delay_sec(1);
LCD_CLEAR();
if (sec==59)
{
min=min 1;
if(min==60)
{
if(hr==11&&min==60&&sec==59)
{hr=0;min=0;sec=0;}
else
{ hr=hr 1;
min=0;}
}
}
} }
else
{
if(P1_5==0) /*if P1_5 is grounded enter the 24hr loop */
{
for (sec=0;sec<60;sec )
{
LCD_DisplayNum(hr,2);
LCD_STRING(":");
LCD_DisplayNum(min,2);
LCD_STRING(":");
LCD_DisplayNum(sec,2);
LCD_STRING(" (24 HR)");
delay_sec(1);
LCD_CLEAR();
if (sec==59)
{
min=min 1;
if(min==60)
{
if(hr==23&&min==60&&sec==59)
{hr=0;min=0;sec=0;}
else
{ hr=hr 1;
min=0;}
}
}
} }}
LCD_INIT();
}
}

I am new in MCU world. I got this program from somewhere in internet, I am working with keil compiler, but the problem is I cant get the lcd.h and delay.h
Please tell me what should I do..
Thanks in advance...
:smile:
 

These libraries can be the compiler libraries in which case they may also be copyrighted or they can be custom libraries written for the specific project.
These files should be available "somewhere in internet" where you found the rest of the code.

Alex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top