Here's one, 1068 cm max range.
http://www.maxbotix.com/products/MB1261.htm
We use analog voltage, the data sheet for this one says:
Pin 3 -
(AN) This pin outputs analog voltage with a scaling factor of
(Vcc/1024) per 2 cm. A supply of 5V yields ~4.9mV/2cm., and 3.3V
yields ~3.2mV/2cm.
So you just connect your +, ground, and signal wire of your pwm accordingly, and plug it into the analog breakout.
It says "about 4.9mV/2cm" So +/- 2cm, maybe a little less accurate than that though.
As far as code goes, it's just a proportion between your voltage and your distance, hence "4.9mV/2cm"
If java's your kind of thing, get.Voltage(); (from AnalogChannel class) it will return the voltage of the sensor, use the above proportion to convert that to a distance.
__________________
Grow the roses of success!
2011 Archimedes 2nd seed,
2011 Waterford Champion, 2011 Troy Simi-Finalist,
2011 Waterford Rookie all star, 2011 Troy Rookie all star
http://www.bytingbulldogs.com/