a few weeks ago I became the proud owner of both an Arduino Uno AND Mega. And as such I started programming in the "arduino" C-code. Most of which is relatively simple to understand, however, I keep running into a problem I can't seem to solve myself. And the most annoying thing about this problem is that it seems simple to solve... but I could be very wrong about that.
I'm trying to make a program that -in a while() loop- starts a timer with the negative flank of one inputpin and stops/saves value/resets the timer with the negative flank of another inputpin. I need this because I'm trying to measure time between two separate signals (the before mentioned inputpins) that enter a HIGH state a few hundred microseconds after eachother (this time varies between 0.15 ms and 6 ms).
I have taken a particualr interrest in the Interrupts that usually are mentioned when people on this forum want to make something similar, yet these don't seem to be leading me anywhere(?).
Also the StopWatchClass seemed to be perfect for this case but I can't get the stopwatch to start/stop at the right moment and sometimes not at all...
PulseIn worked perfectly for a different part of the program that measures RPM.
I was wondering whether anybody present on this forum might have one of those great "how-about-you-check-this-link" type of suggestions?
Greetings from Holland.