Instructional Material: Exercise: Using a Range Sensor

Modern Robotics has a range sensor designed for use with the Tetrix control system. This sensor can read the distance to a surface when the surface is between 5 and 255 centimeters of the sensor. The FTC SDK has a sample program you can use to experiment with the range sensor. In AS, open the path FtcRobotController/java/[first package]/external.samples/SensorMRRangeSensor. You can enable this program and work with it but any changes you make will be overwritten at the next update of the SDK. You can copy this class to the teamcode area so any changes you make will be retained.

Here is a detailed discussion of the range sensor on the Modern Robotics website. There is a link on that page to programming information. This is recommended viewing.

Note that with the REV Hub the MR Range sensor is plugged into an I2C port and configured by adding the device to the I2C Bus number matching the physical I2C port you plugged the sensor into.

REV has a distance sensor as well and sample code for it can be found at FtcRobotController/java/[first package]/external.samples/SensorREV2mDistance.

Note that with the REV Hub the distance sensor is plugged into an I2C port and configured by adding the device to the I2C Bus number matching the physical I2C port you plugged the sensor into.

Material Type: 
Lab Activity
Education Level: 
Middle School
High School
Focus Subject: 
Computing / Computer Science
Robotics Software
HW Platform: 
Tetrix
SW Platform: 
Java
Interactivity Style: 
Mixed
Audience: 
Learner