Added HC-SR04 ping sensor to C library
GeeksGoneBad
Posts: 100
Hey everybody - I was playing around with my cheap HC-SR04 Ping sensor and the new SimpleIDE - anyway I noticed that the library only supported the Ping with the trigger and echo on the same pin and the HC-SR04 has the echo and trigger on different pins...
anyway I modified the Ping library and added support for the HC-SR04 sensor - who should I send it to?
Jamie
anyway I modified the Ping library and added support for the HC-SR04 sensor - who should I send it to?
Jamie
Comments
Is there a standard place such things can get posted?
Is there some place I can download it from?
Oops, sorry; didn't notice that this wasn't SPIN code.
so basically I added the functions
ping_hcsr04(echopin, triggerpin)
ping_cm_hcsr04(echopin, triggerpin)
ping_inches_hcsr04(echopin, triggerpin)
you can replace your libping library in the Learn\SimpleLibraries\Sensor folder as I did not alter the original functions so those should still work as before
hope that helps a few people!
libping.zip
C code is allowed on the Obex as long as there's no license conflict. Use the C language indicator when submitting; we want to encourage PropGCC C code to use that label.