Closed brasta78 closed 6 years ago
What version are you using, pure Java or JNI? Have you seen the doc at https://github.com/OlivierLD/raspberry-pi4j-samples/blob/master/RangeSensor/README.md ? What range of distances are you talking about?
I'm using JAVA. I have 2 other java class for testing HC-SR04 and both return correct result. HC-SR04.java return exactly x10 smaller My testet range was 187cm
I'll make some tests. Could you send the java classes you use for testing? Also see the document at https://github.com/OlivierLD/raspberry-pi4j-samples/blob/master/RangeSensor/README.md Have you tried to use JNI_HC_SR04.java instead of HC_SR04.java ?
these classes return exact result https://gist.github.com/rutgerclaes/6713672 https://github.com/oksbwn/Ultrasonic-Sesnor-With-Raspberry-Pi/blob/master/Code/src/Main.java
JNI_HC_SR04.java dindn't tested
Fixed! Thanks to @brasta78 .
returning x10 smaller distance that it is