Details !
By "rate", did you mean the number of people passed in one minute?
IF yes, then use Timer1 module of the PIC at 1:8 scale and have 500ms timing interval. This way, you can have Timer1 module timing in the background while you can at the sametime have your counting in the foreground.
OR
You can just use simple PAUSE command to create 1 minute timing interval and have your counting in a WHILE statement.
For example,
Code:
CountPin VAR PORTA.0
Timing VAR WORD
Counter VAR WORD
Timing = 0
Counter= 0
Start:
WHILE Timing < 6000
IF CountPin = 0 THEN
WHILE CountPin = 0 : WEND
Counter = Counter + 1 'Number of people Passed
Timing = Timing + 1 'Timing: 6,000x10ms=60,000ms (1 min)
PAUSE 10
ENDIF
WEND
Timing = 0
Goto Start
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks