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 / Please convert code to flowchart…Now I am confused

Please convert code to flowchart…Now I am confused

|

Microcontroller › 8051 › Please convert code to flowchart…Now I am confused

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 1 month ago by Anonymous.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 16, 2016 at 8:18 pm #4467
    Voraphan
    Participant

    #include <reg51.h>
    sbit rs=P3^0;
    sbit e=P3^2;
    void delay(int x);
    void init_LCD();
    void write(unsigned char dat, add);
    void enable();
    void main()
    {char num[10]={'0','1','2','3','4','5','6','7','8','9'};
       char text[9]={'O','U','R',' ','C','L','O','C','K'};
       int  hour,minit,i;
       init_LCD();
       while(1)
        {  for(i=0;i<9;i++)
           write(text,0x84+i);
           for(hour=0;hour<24;hour++)
           for(minit=0;minit<60;minit++)
            { write(num[hour/10],0xC6);
              write(num[hour%10],0xC7);
              write(':',0xC8);
              write(num[minit/10],0xC9);
              write(num[minit%10],0xCA);
            }  
        }
     }
    void delay(int x)
    {for(x=x;x>0;x–);
    }
    void enable()
    { e=1;
    delay(500);
      e=0;
      delay(500);
    }
    void init_LCD()
    { //LCD 16*2
      delay(20000);
      rs=0;
      P2=0x38;
      enable();
      //clear
      rs=0;
      P2=0x01;
      enable();
      //Cursor shift right
      rs=0;
    P2=0x06;
      enable();
        // Display LCD
      rs=0;
      P2=0x0C;
      enable();
     }
    void write(unsigned char dat, add)
    { //add locate
      rs=0;
      P2=add;
      enable();
      //write data to LCD
      rs=1;
      P2=dat;
      enable();
    }

     

    ……Thank you

    May 20, 2016 at 9:44 am #13928
    Anonymous
    Guest

    ok . provide ur email id to send flow chart of this prgm. bcoz, i didn't know how to post image in this.

  • 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

  • Fun with AI and swordfish basic June 23, 2025
  • Simple LED Analog Clock Idea June 23, 2025
  • Microinverters and storeage batteries? June 23, 2025
  • PIC KIT 3 not able to program dsPIC June 23, 2025
  • Is AI making embedded software developers more productive? June 23, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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