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
 
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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…