reading values from the serial port
in
Programming Questions
•
1 year ago
Hi all
I'm communicating between SHT15 sensor and Arduino EtherTen via serial port.
I wanted Processing to read one set of values and evaulate it before it can read the next set of values.I am not sure if that is possible.
I have tried to do that in the code below. I get the following error. I am not sure if the way I have written my code actually is correct format.I have researched online but please advice
*****************************************************************************************************************************
*****************************************************************************************************************************
expecting SEMI, found ')'
processing.app.SketchException: Syntax error, maybe a missing semicolon?
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:307)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:197)
at processing.mode.java.JavaBuild.build(JavaBuild.java:156)
at processing.mode.java.JavaBuild.build(JavaBuild.java:135)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:176)
at processing.mode.java.JavaEditor$20.run(JavaEditor.java:481)
at java.lang.Thread.run(Thread.java:662)
*****************************************************************************************************************************
*****************************************************************************************************************************
void draw() {
//background(inByte);
for (i=0; i<0) {
i = i+ 1 ;
while (myPort.available () > 0) {
int inByte = myPort.read();
char val = char(inByte);
//print(val);
String sc = str(val);
print (sc);
//String[] values = splitTokens(sc, ", ");
//print(values[0]); // Prints "a"
//print(values[1]); // Prints "b"
}
i=0;
}
}
1