I’m new to the Processing language. I am trying to run the code for the Arduino Networked Lamp as detailed in the Getting started with Arduino book. I’ve downloaded the program titled ex06 01 processing and I get the following error when I compile it:
Please show your imports. The error means, that the Serial class exists more than once in your imported libraries. Best practice is not using asterisks on imports, but rather using the explicit imports for your needs.
If you, for example, use
import processing.serial.*;
import java.io.*;
Serial serial;
It don’t know which Serial to take for Serial, as there are.
If you know which Serial you want you can explicitly specify to use then e.g.
import processing.serial.*;
import java.io.*;
processing.serial.Serial pSerial;
java.io.Serial ioSerial;
// and create them explicitly where ... are the necessary parameters
pSerial = new processing.serial.Serial(...);
ioSerial = new java.io.Serial(...);