Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

count up/down

Status
Not open for further replies.

koloua

New Member
can anyone help me with any C language codes of counting how many people passing an infra red sensor........please
 

MikeMl

Well-Known Member
Most Helpful Member
How does the sensor know if a person is entering or leaving a room?

otherwise c=c+1 or c=c-1 :rolleyes:
 

ChrisP58

Well-Known Member
Most Helpful Member
To know which direction a person is going, you will need two sensors, set a few inches apart. The direction is determined by which sensor trips first.

Think of sensor A as the count, and sensor B is the direction.
- If sensor B is high when sensor A trips, increment the count.
- If sensor B is low when sensor A trips, decrement the count.

This assumes that only one person passes through the sensor range at a time.
 
Status
Not open for further replies.

Latest threads

Top