I am struggling how to read float value from inputStream. I tried before with BigDecimal, and it was not possible to get the correct number
Problem: im expecting V ~0.00 - 1.50, Later up to 55.00
While V = ~0.00, it prints 6.336931E-10, V = ~1.05 - 2.53483E-9
Java code:
DataInputStream inputStream = null;
try {
inputStream = new DataInputStream(btSocket.getInputStream());
float f = inputStream.readFloat();
System.out.println(f);
} catch (IOException e) {
e.printStackTrace();
}
To visualize sent values:

To read
floatvalues withDataInput, they need to be written in a compatible format, which is essentially a 32-bit IEEE 754 float.Your Arduino code appears to be writing them as new-line separated decimal strings.
Those won't work together.
If you want to modify your Java to read text, something like this should work: