I have a Maple but rare access to an oscilloscope. In addition, I have a program that runs every 17 ms or so, which makes it hard for me to just light up an LED to check the output state and timing. I asked a friend to borrow his Arduino, and now I'm wondering if it might work to turn the Arduino into a raw data collector for an oscilloscope. Preferably I would use a Maple because I will be using interrupts to log events, but the Arduino will have to suffice. I know that the frequency of the events is constant (and repeatable unless the code happens to get buggy after a few billion cycles), so my major issue is collecting data for a specific time period. I was thinking something like:
long t_0 = millis();
while(millis < (t_0 + 1000)) {
;
}
detachInterrupt();
I'm not entirely sure how well that would work, but that would be the basis for timing (very close to) 1 second. I would simply use a counter to log events.
In the more complicated form, I would use an array to both log events and "time stamp" them. I know there was another thread (http://forums.leaflabs.com/topic.php?id=717) that dealt with this issue, but advice on how to time stamp for longer intervals (like 1 second) without losing accuracy would be appreciated. Let me know what you all think!