View Full Version : Questions about ultrasonic
beefy1
12-23-2008, 12:36 PM
im using wpilib, are the pings automatically sent or i have to call this? please if you can, show me an example of code how to check if the robot is place by 2 inches from a wall.
tdlrali
12-23-2008, 01:17 PM
Are you using LV or WR?
In C++, you have two options. You can repeatedly call the Ping() method, or you can set your sensor to automatic mode using SetAutomaticMode(true). Either way, after you've gotten at least one measurement back, use GetRangeInches or GetRangeMM to get the respective measurement.
keehun
12-30-2008, 10:59 PM
And if you are using LabView, you can get the manual analog input and divide it by howmany volts the spec sheet says is per centimeter or meter.
DonRotolo
01-02-2009, 08:35 PM
It also depends on which ultrasonic sensor you are using. The Maxbotix sensor can deliver the distance as a voltage of 0 to 2.55 volts, corresponding to 0 to 255 inches. In that case you would just read the analog value.
Daniel_LaFleur
01-02-2009, 09:43 PM
It also depends on which ultrasonic sensor you are using. The Maxbotix sensor can deliver the distance as a voltage of 0 to 2.55 volts, corresponding to 0 to 255 inches. In that case you would just read the analog value.
How linear are they and is there a myopic zone?
vBulletin® v3.6.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.