Hi there,
It is likely that you you are referencing a serial port that returns ‘null’. This means there is nothing listed as COM5.
Perhaps if you comment out //myPort = new Serial(this. “COM5”, 9600);
then read the print out in the console of the previous line -
printArray(Serial.list());
You may then
-replace Com5 with a different value from the list and see if you code runs.
or
You can check if COM5 is listed with different syntax.
Hope this helps.
Cheers,
jsg