public class ADXRS450_Gyro extends GyroBase implements Gyro, PIDSource, LiveWindowSendable
This class is for the digital ADXRS450 gyro sensor that connects via SPI.
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond| Constructor and Description | 
|---|
| ADXRS450_Gyro()Constructor. | 
| ADXRS450_Gyro(SPI.Port port)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | calibrate()Calibrate the gyro by running for a number of samples and computing the center value. | 
| void | free()Delete (free) the spi port used for the gyro and stop accumulating. | 
| double | getAngle()Return the actual angle in degrees that the robot is currently facing. | 
| double | getRate()Return the rate of rotation of the gyro. | 
| void | reset()Reset the gyro. | 
getPIDSourceType, getSmartDashboardType, getTable, initTable, pidGet, setPIDSourceType, startLiveWindowMode, stopLiveWindowMode, updateTablecheckAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModuleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPIDSourceType, pidGet, setPIDSourceTypestartLiveWindowMode, stopLiveWindowMode, updateTablegetSmartDashboardType, getTable, initTablepublic ADXRS450_Gyro()
public ADXRS450_Gyro(SPI.Port port)
port - The SPI port that the gyro is connected topublic void calibrate()
Gyropublic void reset()
Gyropublic void free()
free in interface Gyrofree in class SensorBasepublic double getAngle()
GyroThe angle is based on the current accumulator value corrected by the oversampling rate, the gyro type and the A/D calibration values. The angle is continuous, that is it will continue from 360 to 361 degrees. This allows algorithms that wouldn't want to see a discontinuity in the gyro output as it sweeps past from 360 to 0 on the second time around.
This heading is based on integration of the returned rate from the gyro.