Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image processing 处理错误ArrayIndexOutOfBoundsException:32_Image Processing_Processing - Fatal编程技术网

Image processing 处理错误ArrayIndexOutOfBoundsException:32

Image processing 处理错误ArrayIndexOutOfBoundsException:32,image-processing,processing,Image Processing,Processing,那代码怎么了 任何建议都将不胜感激请注意printArray(Serial.list())的控制台输出 在索引0处有一个串行端口“COM4” 任何高于该值(例如32)的索引都超出有效数组索引界限 您正在使用的代码有一条有用的注释: myPort = new Serial(this, Serial.list()[32], 115200); 只需将32换成0就可以了 试着阅读并理解你使用的代码:想象一下你阅读的代码会做什么,以及它是如何运行的,然后实际运行它,并将你的假设与实际行为进行比较。在您

那代码怎么了


任何建议都将不胜感激

请注意
printArray(Serial.list())
的控制台输出

在索引0处有一个串行端口“COM4”

任何高于该值(例如32)的索引都超出有效数组索引界限

您正在使用的代码有一条有用的注释:

myPort = new Serial(this, Serial.list()[32], 115200);
只需将32换成0就可以了

试着阅读并理解你使用的代码:想象一下你阅读的代码会做什么,以及它是如何运行的,然后实际运行它,并将你的假设与实际行为进行比较。在您不熟悉的地方使用处理参考。作为程序员,这将对你有很大帮助


有关更多详细信息,请参见。

请说明所做的研究,并提出更具体的问题。目前这个问题太模糊了。
// if you are a Windows user, please change Serial.list()[your number]