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 / lcd

lcd

|

Microcontroller › AVR › lcd

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 7 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 16, 2013 at 5:58 am #2487
    Nain
    Participant

    i’m using this code for lcd bt it’s showing error ;plz help me out with the errors

    #include<avr/io.h>
    #include<util/delay.h>
    void lcd_init()    // fuction for intialize
    {
    lcd_cmd(0x02);    // to initialize LCD in 4-bit mode.
    lcd_cmd(0x28);    //to initialize LCD in 2 lines, 5X7 dots and 4bit mode.
    lcd_cmd(0x0C);
    lcd_cmd(0x06);
    lcd_cmd(0x83);
    }
    void lcd_cmnd(unsigned char X)
    {
    PORTB=X;
    PORTD|=_BV(PD0);
    PORTD&=~(_BV(PD1));
    PORTD|=_BV(PD2);
    _delay_ms(10);
    PORTD&=~(_BV(PD3));
    }
    void lcd_data(unsigned char Y)
    {
    PORTB=Y;
    PORTD&=~(_BV(PD0));
    PORTD&=~(_BV(PD1));
    PORTD|=_BV(PD2);
    _delay_ms(10);
    PORTD&=~(_BV(PD3));
    }
    void main()
    {
    DDRB=0xff;
    DDRD=0xff;
    lcd_init();
    while(1)
    {
    lcd_data(‘P’);
    lcd_data(‘R’);
    lcd_data(‘I’);
    lcd_data(‘N’);
    lcd_data(‘C’);
    lcd_data(‘E’);
    }}

    June 17, 2013 at 11:08 am #9973
    AJISH ALFRED
    Participant

    Hi Nain,

    If you are getting errors during the compilation then please post the error dialogue. If you have errors when the code runs please post the details.

  • 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

  • Best practices for accurate LiPo battery monitoring on ESP32? January 21, 2026
  • Flip Flop for My Mirrors January 21, 2026
  • Micro mouse January 21, 2026
  • My Advanced Realistic Humanoid Robots Project January 20, 2026
  • A Must-Watch Video Showing Dangerous Construction of Cheap Lithium-Ion Cells January 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