|
Re: Programming ultrasonic rangefinders
What specific sensor are you planning to use, and what kind of signal does it provide to the control system? Some have an analog voltage which is proportional to the range. Others have a PWM signal that varies depending on the range. Still others are a serial (e.g. SPI or I2C) connection that encodes a number.
Whatever you get, it's almost certainly going to be a simple matter of multiplying the value by an appropriate constant to turn it into a distance in whatever units you want.
|