Instructional Material: Exercise: Using a Compass

Modern Robotics has an Compass sensor designed for use with the Tetrix control system. This sensor can read the magnetic heading of the sensor, acceleration and tilt. The FTC SDK has a sample program you can use to experiment with the Optical Distance sensor. In AS, open the path FtcRobotController/java/[first package]/external.samples/SensorMRCompass. 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 the class in the teamcode area so any changes you make will be retained.

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

Note that with the REV Hub the Compass 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: 
SW Platform: 
Interactivity Style: