EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / code problem – using 8051 microcontroller (AT89S52)

code problem – using 8051 microcontroller (AT89S52)

|

Microcontroller › 8051 › code problem – using 8051 microcontroller (AT89S52)

  • This topic has 1 reply, 2 voices, and was last updated 11 years ago by Ashutosh Bhatt.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 30, 2015 at 5:43 am #3587
    Muhamad Reduan Bin Azlee Lee
    Participant

    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);
    }
    April 17, 2015 at 11:36 am #12804
    Ashutosh Bhatt
    Participant

    the error is correct

    where is ur lcd.h file

    u have to copy-pest lcd.h file into project folder

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026
  • Beginner Questions About CNC Machines – G-code, Control Systems & Accuracy April 21, 2026
  • A Must-Watch Video Showing Dangerous Construction of Cheap Lithium-Ion Cells April 21, 2026
  • S1MJ ? April 20, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise