This is possible because of an update in the Arduino software.
New to Arduino? Check out What Is Arduino?
In the newest version of the Arduino software, there’s a tool that makes it super easy to build a simple oscilloscope!
It’s called Serial Plotter and it works like this:
It listens on a serial port, and it plots every number that it sees.
That means, to create an oscilloscope, all you need to do is to write code that prints out the voltage value from an analog input, and the arduino plotter will take care of the rest.
I only used 7 lines of code to make this work!