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 / led display 0 – 9 with switch

led display 0 – 9 with switch

|

Microcontroller › 8051 › led display 0 – 9 with switch

  • This topic has 2 replies, 3 voices, and was last updated 10 years, 3 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 30, 2015 at 2:44 pm #4020
    eshwar
    Participant
    #include <REGX51.H>
     
     
    sfr  ldata =0x90;
    sbit rs = P2^0;
    sbit rw = P2^1;
    sbit  e = P2^2;
    sbit sw = P2^3;
    sbit led= P3^0;
    void delay(int x)
    {int i;
    for( i = 0; i<10;i++)
    {
    for(x = 0; x<1250; x ++);
    }
    }
     
    void lcdcmd(unsigned char x)
    {
    ldata = x;
    rs = 0;
    rw = 0;
    e = 1;
    delay(10);
    e = 0;
    }
     
    void lcddata(unsigned char y)
    {
    ldata = y;
    rs = 1;
    rw = 0;
    e = 1;
    delay(10);
    e = 0;
    }
     
    void init_lcd()
    {
    }
     
    void main()
    {
    char i[10] = "0123456789";
     
    char k;
     
     
    lcdcmd(0x38);
    lcdcmd(0x06);
    lcdcmd(0x0E);
    lcdcmd(0x01);
    lcdcmd(0x80);
    delay(100);
    if(sw==0)
    {
    led = 0;
    for( k =0; k<10;k++)
    {
    delay(100);
    lcddata(i[k]);
    delay(100);
    lcdcmd(0x01);
    delay(100);
     
    }
    led = 1;
    }
     
    }
     
     
     
     
     
     
     
     
    October 1, 2015 at 12:15 pm #13341
    Vara Ashishkumar
    Participant

    Hey eshwar,

    Please discribe your stuff in brief.

    October 3, 2015 at 8:11 pm #13347
    Ashutosh Bhatt
    Participant

    this is the program to display 0 to 9 one by one on LCD

    now tell us what is ur problem? what u want to do?

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

RSS Recent Posts

  • 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
  • Vintage "learning" Maze runner mouse design, for general interest 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