After using my Arduino Fio to make an Arduino LCD oscilloscope, I wanted to try adding a second channel. Using the single channel Arduino FIO LCD Oscilloscope code as a template, I modified the project and added a second channel.
Here’s a short demonstration video of the new two channel project:
Click through the break to check out the code.
The basic modification was to include a second set of variables that is used to store the second channel’s readings. A more elegant solution would have been to make each variable an N-channel array (so that one could easily scale to more channels), but the low-resolution monochrome display really limits the possibilities, unfortunately. In addition, the sampling rate for the single channel oscilloscope was already quite low (with a maximum sampling rate of approximately 28kHz), but two channels could allow for some interesting possibilities as long as one can deal with the slower acquisition speed.
The display refresh is triggered by a rising signal (useThreshold == 1) on the channel A input (analog pin 7, as defined by theAnalogPinA = 7), but you could easily modify the code to make this switchable so that either channel acts as the trigger. The code is very similar to my previous code, including the serial port parameter controls, so I recommend taking a look at that post first, if you have any questions: Arduino FIO LCD Oscilloscope
As with the previous single channel project, you need to make sure that you have the u8glib library installed to compile the code.
Here’s the Arduino sketch for the oscilloscope: