Thanks. It's a pity, not many people think like you ;).
I blame myself on it, not to explain "clear" in the beginning.
So , the question is, what is it all about, one more sloppy oscilloscope?
- No, it is more than that. I have a DSO, that cost me ~ 100$, and I love it. Lack of real devise was not a reason to have fun with this project. Let me explain:
1). If the "problem" you are trying to troubleshoot is related to input signal:
- missing input,
- nonlinear reading,
- noise etc.,
all you need is oscilloscope.
Buy one, if you need it more than once, or load my sketch to arduino, solve a trouble, and reload your sketch again. You can combine two sketches, in this case you will be able to put a finger on pulse of the system, whenever I'd like to be sure, it's doing just fine.
Just one more things, for using this project in your design. It's not necessarily, that picture on external device is the same, as picture that coming right after arduino ADC. It's still make sense to load a sketch and get picture from "inside" Atmega chip, in order to figure out wrong DC bias error, interruption conflict, timing or "stroboscope effect" error (when arduino making analog reading with a frequency close to N x F (input signal)).
2). Let's say input signal is perfect (whatever signal in your design is, it could be
temperature, light, pot, pressure, vibration, sound etc), but you still have
a problem after processing your data:
- log/sqrt equation;
- math operation with other variable or input;
- FFT .
And oscilloscope (if you have one ) is absolutely useless here...
Right, the correct way is to use serial monitor, and trek data after each stage,
as they say "Divide and Conquer!!!", check if anything wrong in the code.
But what if data fast varying variable? Serial monitor "slow" device, and even after you print data on monitor, you still couldn't get a "pattern" in it?
Use a plotter, office tools (Excel), Processing or something else to visualize a data.
Only it become too complex to debug simple "blinking led" sketch in first place, and in second, it OS dependable, not easy transferable tools.
And here a solution, osscillo-plotter (hey, if you have a better name for this project, please, say it).
You insert in your sketch two print_chart function: in front of "stage" and right after that. (Don't forget, to replace data in array with "processed" data, before calling print_chart second time.)
And here you are, two plots, "original" and "processed" data.
Changing your math, for example, averaging constant ( two readings, 100, 2000 ???) you can watch how it's affect your data, almost in "real-time".