Convert inputStream to String
- how would you convert an input stream from a bluetooth serial from a byte to a string?
I was able to figure out how to read from the arduino over bluetooth to get the values as a string.
However, i was still unable to: 1) only read certain values 2) assign the values easily to their own variables
i did find a work around method that is not good, but works most of the time. From your transmitting device, mine is arduino, you send the data over with an added splitting term. You add a term to the string such as / or _ so that you can use the processing split() function to break the input string up into an array of strings. then assign the different array value to variables
Example: the string from the arduino is read on android to be ".09675/5.2425/2.4353"
Then you use:
String[] value = split(arduinoString,'/');
println(value[0]+" "+ value[1]+" "+value[2],);
//prints out: .09675 5.2425 2.4353
float x = value[0];
float y = value[1];
etc...
Let me know if this makes sense.