Gyroscope

Part 1: Configuring Your Sensor

- Your Gyroscope should already be configured in I2C Port 0 and named “imu”. Check to make sure this is the case:

Part 2: Running a Test OpMode

- Create a new OpMode and called it “DriveAvoidIMU”. Do not use a sample program.

Section 3: Combining Your Range Sensor and Gyroscope for Accurate Movement

- Piece by piece, copy and paste range sensor code into the correct areas of the gyroscope program. Make sure that the hardware initialization goes in its spot, hardwareMap goes in its spot, etc.

- Now in the main loop of your program you will want your routine to look something like this (note: I have placed comments in the code below that represent commands that you will need to write… I’m not giving you ALL the code here!) :

Last updated

Was this helpful?