14#ifndef VEX_GYRO_CLASS_H
15#define VEX_GYRO_CLASS_H
32 gyro( int32_t index,
bool calibrate=
false, turnType dir = turnType::left );
48 double value( rotationUnits units = rotationUnits::deg );
56 bool startCalibration( gyroCalibrationType
value = gyroCalibrationType::calNormal,
bool waitForCompletion=
true );
58 void calibrate( gyroCalibrationType
value = gyroCalibrationType::calNormal,
bool waitForCompletion=
true ) {
97 double angle( rotationUnits units = rotationUnits::deg );
104 double heading( rotationUnits units = rotationUnits::deg );
111 double rotation( rotationUnits units = rotationUnits::deg );
118 double rate( rateUnits units = rateUnits::dps );
139 enum class tSensitivity {
145 enum class tEventType {
154 tSensitivity _sensitivity;
159 void getAngleAndRate(
void );
160 bool calibrationFlagGet(
void );
161 void setSensitivity( tSensitivity s );
162 double rawToAngle( int32_t raw, rotationUnits units );
163 int32_t angleToRaw(
double angle, rotationUnits units );
double angle(rotationUnits units=rotationUnits::deg)
Gets the angle of the gyro sensor.
void resetRotation()
reset the gyro sensor rotation to 0
double heading(rotationUnits units=rotationUnits::deg)
Gets the angle of the gyro sensor.
bool isCalibrating()
Returns true while the gyro sensor is performing a requested recalibration, changing to false once re...
void setRotation(double value, rotationUnits units)
set the gyro sensor rotation to angle
double rotation(rotationUnits units=rotationUnits::deg)
Gets the absolute angle of the gyro sensor.
turnType getTurnType()
Get direction for positive angles.
gyro(int32_t index, bool calibrate=false, turnType dir=turnType::left)
Creates a new gyro object on the port specified in the parameter.
void changed(void(*callback)(void))
Calls a function when the gyro sensor value changes.
bool startCalibration(gyroCalibrationType value=gyroCalibrationType::calNormal, bool waitForCompletion=true)
Starts recalibration of the gyro.
int32_t value()
Gets the angle of the gyro sensor.
double value(rotationUnits units=rotationUnits::deg)
Gets the angle of the gyro sensor.
void resetHeading()
reset the gyro sensor angle to 0
double rate(rateUnits units=rateUnits::dps)
Gets the turn rate of the gyro sensor.
void setHeading(double value, rotationUnits units)
set the gyro sensor angle to angle
void setTurnType(turnType dir)
Set direction for positive angles.
Bumper switch device class