Poor man's Oscilloscope

Hello, I am trying to use my Arduino Uno as an oscilloscope following this tutorial :

It consists of an Arduino sketch that reads from the Analog pin 0 and a Processing software (Java) that takes this information and displays the graph of V against t in real time.
It also produces a square wave (f = 2Hz) on digital pin 13 to test the oscilloscope. This last feature works normally (tested on an actual oscilloscope).

However, when running the Processing code, this one crashes. I have managed to identify at least one problem : Processing is working with the wrong serial port.
The line of code responsible for this is the following :

port = new Serial(this, Serial.list()[com_port], 9600); // Com port specified here

I would like to specify explicitly the port that I am using in the code to get around this problem but I don't know how to do this.
Could anyone help me ?

Ok, I just got it. I didn't modify the "com_port" to match my actual port. That's what happens when you follow a DIY without actually understanding what you do I guess :confused: