NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

cr0sh:
I've only been keeping up now and then on this thread; I have yet to try the library, but I have to say it seems like an awesome improvement. I was wondering, though, if you were planning on:

  1. Adding the original PING sensor from Parallax to it
  2. Add code for the Polaroid/Senscomp 6500 sensor

I believe the Parallax PING))) sensor would almost work with my library as-is. The only difference would be that the trigger/echo pin would need to switch from input to output as the same pin is used for both. I don't have the sensor to test this, but it appears software-wise the interface is identical except for using a unified pin for both trigger/echo. It would only need a few lines of code modification, and it would be easy to automatically detect that it was a PING))) sensor when the same trigger and echo pin was specified.

If someone has this sensor, I'd be more than willing to make a slight modification to the library for you to test.

The Polaroid/Senscomp 6500 sensor also seems to be similar to the SR04. It does appear that there could be a slight trigger difference (leave the trigger high while sensing?). Again, I don't have this sensor to test. But, this sensor also appears to be not nearly as popular. I can't even find an Arduino library for it.

cr0sh:
Maybe the Maxbotix sensors should be done instead...?

I believe the MaxBotix MaxSonar sensors use an analog, PWM, and serial interface. None of which really match well with the current library interface method. Serial (like I2C) would be out for sure, but it would be possible to implement an analog or PWM interface. Again, I don't have this sensor so I can't really do much with it. Someone have one willing to loan me for a couple weeks?

Also, there's other ultrasonic sensors that use the a I2C interface. These I don't currently plan on supporting. Not because there's anything wrong with them, but because each sensor's I2C commands are totally different. Maybe a PingI2C library just for these sensors that are specialized with the proper commands for each sensor.

Tim