I've changed it again, but the same error message appears...
I'll post up the whole code that I'm actually using it for, just in case it's something in that that is causing the problem:
Code:
import processing.video.*; // import theProcessing video library
import processing.serial.*; // import the Processing serial library
Serial Arduino; // The serial port
Capture webCam; // The webcam feed
PFont font;
float xpos, ypos, onoff, scrolltext, x; // Starting position of the webcam feed
int picture;
float size = 700.0;
String[] feed = new String[] {
"http://www.adelaidecitycouncil.com/netcatapps/webcam/images/centralMkt.jpg", //Adelaide Market
"http://www.cbc.ca/bc/webcam/images/webcam.jpg", // Vancouver Building Site
"http://www.adelaidecitycouncil.com/netcatapps/webcam/images/rundleEast.jpg", //Rundle Mall East & Lantern
"http://www.draperbee.com/webcam/pic/image.jpg?1262444320177", //beehive
"http://www.adelaidecitycouncil.com//NetcatApps/webcam/images/bellsth.jpg" //Adelaide Bell Street South
};
PImage images;
void setup() {
size(678,510,P3D);
font = loadFont("01_Digit-23.vlw");
textFont(font, 23);
// List all the available serial ports & cameras
//println(Serial.list());
//println(Capture.list());
webCam = new Capture(this, width/2, height/2, "USB PC Camera-WDM", 30);
Arduino = new Serial(this, Serial.list()[1], 9600);
// read bytes into a buffer until you get a linefeed (ASCII 10):
Arduino.bufferUntil('\n');
// need as many images as we have feeds
images = new PImage[feed.length];
// initial load of images (slow)
for (int i = 0 ; i < feed.length ; i++){
images[i] = loadImage(feed[i]);
}
}
void draw() {
background(0);
if (webCam.available()){
webCam.read();
}
if (onoff == 1){
image(webCam, xpos, ypos);
}
else{
image(images[picture], xpos, ypos, width/2, height/2);
delay(1000);
}
x = x +3;
if (x > width + size){
x = -size;
}
if(scrolltext == 0){
translate(-x, 0, 0);
text("Directive 1: Mid-life transitions", 0, 494);
}
if(scrolltext == 1){
translate(-x, 0, 0);
text("Directive 2: Books & you", 0, 494);
}
}
void serialEvent(Serial Arduino) {
// read the serial buffer:
String myString = Arduino.readStringUntil('\n');
// if you got any bytes other than the linefeed:
if (myString != null) {
myString = trim(myString);
// split the string at the commas
// and convert the sections into integers:
int sensor[] = int(split(myString, ','));
// print out the values you got:
for (int sensorNum = 0; sensorNum < sensor.length; sensorNum++) {
print("sensor " + sensorNum + ": " + sensor[sensorNum] + "\t");
}
// add a linefeed after all the sensor values are printed:
println();
if (sensor.length > 1) {
xpos = map(sensor[0], 0, 1023, 0, (width - width/2));
ypos = map(sensor[1], 0, 1023, 0, (height - height/2));
picture = (int)map(sensor[2], 0, 1023, 0, images.length - 1);
onoff = map(sensor[3], 0, 1, 0, 1);
scrolltext = map(sensor[4], 0, 1023, 0, 2);
}
}
}