ArrayIndexOutofBoundsException ERROR
in
Core Library Questions
•
10 months ago
Why this is saying ArrayIndexOutofBoundsException: 0
import processing.serial.*;
Serial myPort;
float brightness = 0;
void setup () {
size (1000, 600);
colorMode(RGB);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 9600);
}
void draw () {
background (1);
while (myPort.available()>0){
int inByte = myPort.read();
fill(inByte);
beginShape(QUADS);
vertex(0, 0);
vertex(250, 0);
vertex(250, 150);
vertex(0, 150);
endShape(CLOSE);
}
1