该代码在处理 2 中工作正常,但在 size() 函数中使用处理 3 中的变量不起作用,我将如何在处理 3 中实现 displaywdith-100
int val, screen_increment, old_x=0, old_y=0;
String inString;
int lf = 10;
void setup()
{
size(displayWidth-100, 600);// The screen height is set to be 600, which matches the scaled data,
String portName = Serial.list()[0];
println(Serial.list());
myPort = new Serial(this, portName, 115200);
myPort.bufferUntil(lf);
background(0);
}//setup
Run Code Online (Sandbox Code Playgroud)