Missing right parenthesis HELP
in
Core Library Questions
•
1 year ago
OK so i was just trying to write a class that writes a bunch of different types of variables into one string,After a few gours research and construction i was getting near completion. Towards the end of the projsect i kep getting the "Syntax error maybe missing right parenthesis. Here is my code:
import processing.serial.*;
Serial myPort;
void Setup() {
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
class Comm {
string id;
boolean e1;
boolean e2;
boolean e3;
boolean e4;
boolean e5;
boolean e6;
int XPn;
double Xdist;
int YPn;
double Ydist;
int ZPn;
double Zdist;
};
Comm(string tempid, boolean tempe1, boolean tempe2, boolean tempe3, boolean tempe4, boolean tempe5, boolean tempe6, int tempXPn, double tempXdist, int tempYPn, double tempYdist, int tempZPn, double tempZdist) {
id = tempid;
e1 = tempe1;
e2 = tempe2;
e3 = tempe3;
e4 = tempe4;
e5 = tempe5;
e6 = tempe6;
XPn = tempXPn;
Xdist = tempXdist;
YPn = tempYPn;
Ydist = tempYdist;
ZPn = tempZPn;
Zdist = tempZdist;
}
void Assemble() {
string d = ("{" + id + "}" + e1 + "," + e2 + "," + e3 + "," + e4 + "," + e5 + "," + e6 + ",");
println d; // to test if it works
}
void Transmit() {
myPort.write(d);
}
}
1