Arduin-O-Scope (a tiny oscilloscope project)

I used the timer/interrupt setup so that eventually the user can set the sampling rate to some arbitrary number (1kHz, 5kHz, 10kHz, etc) and have it be somewhat accurate. Hopefully this will mimic the behavior of a 'real' oscilloscope better.

That works for the slower sampling rates but because the overhead in the interrupt handler may get in the way when the sampling rate is fast, why not do a simple test and see how fast you can go with just analogReads and the serial print. If you can get usefully higher sampling rates, then you could use the interrupts for the slower modes and the non-interrupt version for higher speed. You would probably need to pad each analogRead/Serial.print with some delay to round out the sampling rate to a decade boundary.

But it may be that that delays in serial.print are a bigger factor than the interrupts - but it could be intersting to find out :wink: