micro c code for speed calculation using IR sensors

Status
Not open for further replies.

Monetary Monetary

Newbie level 3
Joined
Nov 1, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
21
hie guys, need your help to calculate speed taken by a moving vehicle and display it on LCD.it passes through two pairs of IR sensors which are a fixed distance apart using timers in PIC 16F877A with a 20Mhz oscillator i am using micro c.
it activates timer when it passes 1st sensor and deactivates timer when it passes 2nd sensor but how do i find time taken in micro c
 

can you not derive the time interval from the timer?

another way is to save the time from the 1st sensor, and then save the time from the 2nd - the difference is the time interval
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…