


SmartDashboard.putNumber("Distance (real)", getDistance()) SmartDashboard.putNumber("Distance (volts)", getVoltage())
FRC ULTRASONIC SENSOR PROGRAMMING PDF
Private static final double VOLTS_TO_DIST = 1.0 FRC 2012 Sensor Basics Tutorial - Free download as PDF File (.pdf). (use information from the data sheet, or your own measurements)
FRC ULTRASONIC SENSOR PROGRAMMING HOW TO
TODO - You will need to determine how to convert voltage to distance Explore the wide range of extremely high quality and accurate ultrasonic sensor from Maxbotics and various generic brand. Private static final AnalogInput mb1013 = new AnalogInput(0) The ultrasonic sensor is a more demanding sensor in robotics as well as in industrial purposes. (pins 3, 6 and 7 from sensor to analog input 0) You will need to determine the constant (VOLTS_TO_DIST) to convert the voltage to a real world distance (if you want to work in real world units instead of voltage). 2014 FRC Control System WPILib programming documentation WPILib programming WPILib sensors WPILib Sensor Overview WPILib Sensor Overview The WPI Robotics Library supports the sensors that are supplied in the FRC kit of parts, as well as many commonly used sensors available to FIRST teams through industrial and hobby robotics suppliers. The following class could then be used to display readings from the sensor on the SmartDashboard to help you determine how the voltage output from the sensor corresponds to distance. Assuming that is your sensor, I would recommend that you start with pins 3, 6 and 7 on the sensor and connect them to an analog input on the roboRIO (refer to the data sheet to determine how they should be connected).
