Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

serial problem in reading a string

$
0
0
I am trying to send a string from arduino to processing but that didn't work for me.

I am sending data from arduino by this method
  1.  Serial.println(average*10/1023);
and getting in processing by 
  1.  void serialEvent (Serial myPort) {
  2.  String inString = myPort.readStringUntil('\n');
  3.  float inByte = float(inString);
I am getting this error......

error, disabling serialEvent() for //./COM3
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at processing.serial.Serial.serialEvent(Unknown Source)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)

I don't know how to send data from arduino to get as a string in processing.
Need your valuable suggestion.
thanking you in anticipation

Viewing all articles
Browse latest Browse all 1768

Trending Articles