Hi all,
for my project (dogsport timer) i'm trying to trap how long a passing dog interrupts a photoswitch sensorgate.
crossings & passings in our dogsport
as i'm fairly new to Arduino and C/C++, so i've made a little drawing about what my goal is to achieve.
we've got dogs running one after the other trough a sensorgate, where the "next" dog may not enter the lane before the "previous" dog has left the lane.
my goal is to "trap" the time a certain dog interrupts a photoswicht... my idea was that, maybe it's possible to use two of the provided methods in the interrupts on the arduino (AT Mega 2560 ADK) i use.
maybe i'm totally wrong on what is possible..i realy don't know that.
the idea is to try to write a routine that traps "millis()" on the rising edge of the curve (see attached picture) and also traps the "millis() on the falling edge of the curve... of the same sensor (and thus hardwired to the same arduino PIN)
just the millis() should do, because calculations and displaying would be done on another moment (when de controller has more time to do this sort of work).
I've read Nick Gammon's article about interrupts, but my knowledge for the moment is to small to get this thing to work on my own.
Anyone an idea if this is possible or not?
and above all, where should i start in programming such routine
as one can see in the video, in optimal conditions the time two dogs cross the sensor gate is about the lenght of one dog (in less accurate conditions, this could run up to x2 dogs lenght, without and state change in the lightbeam, in other conditions there maybe a small flat line in the signal before it goes up again...)
Grtz,
Yves