Stanley:
Does this library works with URM37 v3.2 ( URM37_V3.2_Ultrasonic_Sensor__SKU_SEN0001_-DFRobot )Mode 3: PWM passive control mode
Under this mode, a low pull on pin COMP/TRIG will trigger a sensor reading. The width of the pulse is proportional to the servo rotating degree. After a successful sensor reading, Pin PWM will output pulses, every 50us represents 1cm. If the reading is invalid, a 50000us pulse will be returned.Can I use the NewPing library and change the NewPing.h to make it work for the URM37 v3.2 ?
Thanks
Reading the documentation, it appears that it will work with the NewPing library. It does appear that you would need to change the US_ROUNDTRIP_CM to 50 and US_ROUNDTRIP_IN to 127 for the distance calculations to be correct.
With that said, if you don't already have the URM37 and there's not a good reason why you need to buy this specific one, I would suggest getting one that's known to work with NewPing. As a bonus, they're also cheaper than the URM37.
Further, if it was me, and I already had this sensor or was required to use it for another purpose, I would use the serial interface instead of the trigger/PWM interface. There's many benefits of using the serial interface, including setting up automated pings, not waiting for ping echos, getting temperature, etc. They've also created a serial library for the sensor so you don't need too much effort to get it working in this way.
If you do get the sensor working with NewPing, let me know. I'd like to hear your experience.
Tim