Continue to Site

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
 
How does the sensor know if a person is entering or leaving a room?

otherwise c=c+1 or c=c-1 :rolleyes:
 
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

New Articles From Microcontroller Tips

Back
Top