public class EV3GyroSensor extends BaseSensor
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Angle | Measures the orientation of the sensor | Degrees | getAngleMode() |
Rate | Measures the angular velocity of the sensor | Degrees / second | #getRateMode() |
Rate and Angle | Measures both angle and angular velocity | Degrees, Degrees / second | #getAngleAndRateMode() |
Sensor configuration
Use reset()
to recalibrate the sensor and to reset accumulated angle to zero. Keep the sensor motionless during a reset.
The sensor shuld also be motionless during initialization.
See Sensor Product page
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
private class |
EV3GyroSensor.AngleMode |
Modifier and Type | Field and Description |
---|---|
private static long |
SWITCHDELAY |
currentMode, currentModeS, modes
PATH_DEVICE
Constructor and Description |
---|
EV3GyroSensor(java.lang.String sensorPort) |
Modifier and Type | Method and Description |
---|---|
int |
getAngle() |
SampleProvider |
getAngleMode()
EV3 Gyro sensor, Angle mode
Measures the orientation of the sensor in respect to its start orientation. |
void |
reset()
Hardware calibration of the Gyro sensor and reset off accumulated angle to zero.
|
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes, switchMode, switchMode
connect, getIntegerAttribute, getStringAttribute, setIntegerAttribute, setStringAttribute
getElements, readFloat, readInteger, readString, writeInteger, writeString
close, releaseOnClose
private static final long SWITCHDELAY
public SampleProvider getAngleMode()
Size and content of the sample
The sample contains one elements representing the orientation (in Degrees) of the sensor in respect to its start position.
Configuration
The start position can be set to the current position using the reset method of the sensor.
leJOS conventions for
SampleProviders
public void reset()
public int getAngle()