Hey guys~~i have some problems on my program. I was trying to get the readings from the arduino and then using that number as a index to load image from my computer. but i keep getting the "ArrayIndexOutOfBoundsException: 111" report.....
my project is due tomorrow...really appreciate if you could help!!!
code:
```
import processing.serial.*;
Serial myPort;
int val;
int i;
PImage[] images = new PImage[i];
If this were C, "i" would be zero.
[edit]You may get bonus marks if your code is nicely presented. You'll certainly get credit around here for going back to your posts, clicking on "modify", highlighting the code in the editor and clicking on the "Code" (#) button on the toolbar.[/edit]
thank you for the reply! i just changed the 'i' to 'c ', but it still keep telling me:
images[111] = loadImage("111.jpg");
has problem which is ArrayIndexOutOfBoundsException: 111
sorry, i am bit slow to get there......
you mean i should give c an initial value?
basically, i get the reading from the ardunio and i simplify the number to 111, 121,.....so i wish i could import these numbers and using them to load the image from the data folder that has the same name--"111.jpg". do you mean i should change the name?