ArrayOutofBoundException:处理代码时为0

时间:2017-04-02 18:49:38

标签: java arduino processing

背景

目前正在查看此代码,我正在尝试使用Arduino创建家庭照明系统。它可用作电视背光系统,其中边缘像素被平均并在相应的LED's上表示。因此,我正在考虑这个项目here

import java.awt.Robot; //java library that lets us take screenshots
import java.awt.AWTException;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.Dimension;
import processing.serial.*; //library for serial communication
Serial port; //creates object "port" of serial class
Robot robby; //creates object "robby" of robot class


void setup()
{
  port = new Serial(this, Serial.list()[0],9600); //set baud rate
  size(100, 100); //window size (doesn't matter)
  /*try //standard Robot class error check
  {
    robby = new Robot();
  }
  catch (AWTException e)
  {
    println("Robot class not supported by your system!");
    exit();
  }*/
}

错误

但是,当我实例化Serial时,我得到了这个错误。

enter image description here

这里出了什么问题?

0 个答案:

没有答案