hi
I´m doing a proyect, and i need use a scope; i found this code:
import processing.serial.Serial;
import processing.serial.*;
Serial myPort;
int xPos=1;
void setup (){
size(400,300);
println(Serial.list()); //here is the error
myPort = new Serial(this,Serial.list()[0],9600);
//myPort.bufferUntil ('\n');
background(0);
}
void draw () {
}
void serialEvent(Serial myPort){
String inString = myPort.readStringUntil('\n');
if (inString != null){
inString=trim(inString);
float inByte = float(inString);
inByte = map(inByte,0,1023,0,height);
stroke(127,34,255);
line(xPos,height, xPos,height-inByte);
if(xPos>=width){
xPos = 0;
background(0);
}
else{
xPos++;
}
}
}
Processing 3.5.3 show me this:
Type String[] of the last argument to method println(Object…) doesn’t exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.
and don´t show the signal tested.what should i do?