Connecting Arduino to printer GUI

edited June 2014 in Arduino

Hello. I'm trying to work with a 3d printer (this one: https://pwdr.github.io/) and I'm trying to get the Arduino to be read by the GUI used to operate the printer. Now, the GUI program has several files that all show up in the Processing window. The designer of the printer suggested that I change 'selectPort' (see below) under the file/tab called 'Serial' to either the port that the Arduino is connected to (so just maybe write COM3) or to write down COM 1 through 5.

Serial

String[] comList;
int selectPort;
boolean serialSet = false;
Serial arduinoSerial;

String serialString = "Choose the correct Arduino COM port...";

void startSerial(){
  arduinoSerial = new Serial(this, Serial.list()[selectPort], 9600);   //<-----Here is the line I'm talking about
  arduinoSerial.bufferUntil(10);
  serialSet = true;
  serialString = "Serial port #"+selectPort+" connected";
}

void serialEvent(Serial p) { 
  // read the string from serial
  serialString = p.readString(); 
}

void serialSend(String serialTemp){

  println(serialTemp);

  if (serialSet){
    arduinoSerial.write(serialTemp);
  } else { 
    serialString = "Arduino not connected";
  }
}

Now, when I type in just a single port I get "Cannot find anything named X".(X being whatever I typed). When I type in multiple ports, I get a syntax error on another file/tab called FloodFill (see below, lines 70-87(end) shown). I get "Syntax error, maybe missing a ] character?"

FloodFill . . .

 // catch exceptions...
  // stack is empty when we're finished filling, so just ignore
  catch(EmptyStackException e) {
  }
  // catch other exceptions
  // e.g. OutOfMemoryException, though shouldn't be caused by filler
  catch(Exception e) {
  }
}

class Vec2D {
  public int x,y;

  Vec2D(int x,int y) {
    this.x=x;
    this.y=y;
  }
}                         // <-----Error is highlighted here

So, does anybody have any suggestions? Again the GUI isn't picking up the Arduino. Let me know if you need to see the rest of the FloodFill code. Thanks. By the way, the printer needs to use Processing 1.5.1 not 2.0. Not sure if that's important, but worth mentioning.

Sign In or Register to comment.