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 give me c coding for bidirectional visitor counter using AT89C52

Please give me c coding for bidirectional visitor counter using AT89C52

|

Microcontroller › 8051 › Please give me c coding for bidirectional visitor counter using AT89C52

  • This topic has 1 reply, 2 voices, and was last updated 15 years ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 21, 2011 at 6:41 pm #4726
    Dhananjay
    Participant

    February 22, 2011 at 6:50 am #5572
    dagakshay
    Participant

    here i am writing the algo code it by yourself

     

    i assumed

    the RX1 is inside the room and rx2 is out side the room….

     

    the variable for the number of came person inside a room is total_in

    similarly the number of person outside the room is total_out

    and the number of person present in side is present_in = total_in – total_out;

     

    let the sensors are connected to port1

    Rx1 to P1.0

    Rx2 to P1.1

    rest of the pins are high

    when any one comes inside the room first out sensor will sens the person and the inside one

    similarly when any one goes out side from room the inside sensor will sense the person first then the out side one

    the sensors are active low o/p

     

    algo:

    while(1)

    {

    while(P1= 0 0xff)

    if(P1_0= =0) // inside sensor ; person is going out

      {  

      while(P1_1 = = 1);

      total_out++;

      delay_1s( );

      } 

     

    else if(P1_1= =0) // outside sensor ; person is comming inside

      {  

      while(P1_0 = = 1);

      total_in++;

      delay_1s( );

      } 

     

    present_in = total_in – total_out;

     

    display(present_in);

    }

     

     

     

     

     

  • 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

  • excessive technology in multimeters March 9, 2026
  • energising a solenoid March 9, 2026
  • Pnp transistor query March 9, 2026
  • Project boxes March 8, 2026
  • MCS-51 Development Ecosystem March 8, 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