Sharp IR Distance Sensor

C, C++, and Visual C++
Post Reply
dguimaraes
Fresh meat
Posts: 3
Joined: Fri May 24, 2019 3:40 am
Contact:

Sharp IR Distance Sensor

Post by dguimaraes »

Hi,
I'm using Sharp Distance Sensor (20-150cm) with IR Distance Adapter.
If I declare the sensor type:

PhidgetVoltageRatioInput_setSensorType(voltageRatioInput0, SENSOR_TYPE_1101_SHARP_2Y0A02);

After this I never receive reads... I only can use this setup receiving values from voltageRatio value... how can i receive data in distance like mm

thanks
User avatar
Patrick
Lead Developer
Posts: 656
Joined: Mon Jun 20, 2005 8:46 am
Location: Calgary
Contact:

Re: Sharp IR Distance Sensor

Post by Patrick »

If you open it in voltage ratio mode, what range of values are you getting?

The formula for converting voltage ratio to distance is:

Distance (cm) = 9.462 \ (VoltageRatio - 0.01692)

This formula is only valid for VoltageRatio between 0.08 and 0.49.

-Patrick
Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests